[core] pretty logs by default

This commit is contained in:
devlikepro committed 2024-07-05 13:40:13 +03:00
1 parent acec292b0f
commit 219b4dca94
1 file changed
+9 -13
+9 -13
View File
@@ -44,22 +44,18 @@ export function getDefaultPinoLogLevel(): Level {
}
export function getPinoTransport() {
const logFormat = (process.env.WAHA_LOG_FORMAT || '').toUpperCase();
if (!logFormat) {
return;
}
const logFormat = (process.env.WAHA_LOG_FORMAT || 'PRETTY').toUpperCase();
if (logFormat == 'JSON') {
return undefined;
}
if (logFormat == 'PRETTY') {
return {
target: 'pino-pretty',
options: {
singleLine: true,
colorize: true,
},
};
}
return {
target: 'pino-pretty',
options: {
singleLine: true,
colorize: true,
messageFormat: '{if session} session:{session} - {end}{msg}',
},
};
}
export { getNestJSLogLevels };