feat: add LOG_LEVEL env. var.

This commit is contained in:
Ali BARIN
2023-05-24 10:43:36 +00:00
parent 9701c98af9
commit 4f46c55c85
3 changed files with 31 additions and 32 deletions

View File

@@ -9,10 +9,6 @@ const levels = {
debug: 4,
};
const level = () => {
return appConfig.appEnv === 'development' ? 'debug' : 'info';
};
const colors = {
error: 'red',
warn: 'yellow',
@@ -41,7 +37,7 @@ const transports = [
];
export const logger = winston.createLogger({
level: level(),
level: appConfig.logLevel,
levels,
format,
transports,