Skip to content

Commit

Permalink
fix: should add paddingMessage on ConsoleLogger (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Dec 31, 2023
1 parent b2bf43a commit eb73f50
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} `;
}
let msg = meta.date + ' ' + meta.level + ' ' + meta.pid + paddingMessage + meta.message;
if (!chalk.supportsColor) {
return msg;
}
Expand Down

0 comments on commit eb73f50

Please sign in to comment.