Skip to content

Commit

Permalink
fix: should add paddingMessage on ConsoleLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 31, 2023
1 parent b2bf43a commit e914905
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ module.exports = {

// output to Terminal format
consoleFormatter(meta) {
let msg = meta.date + ' ' + meta.level + ' ' + meta.pid + ' ' + meta.message;
let paddingMessage = ' ';
// try to use the exists paddingMessage first
if (meta.paddingMessage) {
paddingMessage = ` ${meta.paddingMessage} `;
}

Check warning on line 79 in lib/utils.js

View check run for this annotation

Codecov / codecov/patch

lib/utils.js#L78-L79

Added lines #L78 - L79 were not covered by tests
let msg = meta.date + ' ' + meta.level + ' ' + meta.pid + paddingMessage + meta.message;
if (!chalk.supportsColor) {
return msg;
}
Expand Down

0 comments on commit e914905

Please sign in to comment.