Skip to content

Commit

Permalink
feat: remove numeric log level if output is a known log level
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Aug 27, 2022
1 parent e9ba028 commit 5348c44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/factories/createLogFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export const createLogFormatter = (configuration: LogFormatterConfigurationType)
throw new Error('Unexpected state.');
}

formattedMessage += ' ' + logLevelColorName(logLevelName + ' (' + String(message.context.logLevel) + ')');
if (message.context.logLevel % 10 === 0) {
formattedMessage += ' ' + logLevelColorName(logLevelName);
} else {
formattedMessage += ' ' + logLevelColorName(logLevelName + ' (' + String(message.context.logLevel) + ')');
}
}

if (message.context.package) {
Expand Down

0 comments on commit 5348c44

Please sign in to comment.