feat: use ts, update cd, update README (#12)

Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
Jef LeCompte
2020-09-18 04:27:23 -04:00
committed by GitHub
parent dcbaa6bb2e
commit e9fc0bf5f7
25 changed files with 6632 additions and 228 deletions
+23
View File
@@ -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({})
]
});