mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 11:07:43 +00:00
feat: use ts, update cd, update README (#12)
Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import winston, {format} from 'winston';
|
||||
|
||||
const prettyJson = format.printf(info => {
|
||||
if (typeof info.message === 'object') {
|
||||
info.message = JSON.stringify(info.message, null, 4);
|
||||
}
|
||||
|
||||
return `${info.level} :: ${info.message}`;
|
||||
});
|
||||
|
||||
export const Logger = winston.createLogger({
|
||||
level: process.env.LOG_LEVEL ?? 'info',
|
||||
format: format.combine(
|
||||
format.colorize(),
|
||||
format.prettyPrint(),
|
||||
format.splat(),
|
||||
format.simple(),
|
||||
prettyJson
|
||||
),
|
||||
transports: [
|
||||
new winston.transports.Console({})
|
||||
]
|
||||
});
|
||||
Reference in New Issue
Block a user