Skip to content

Commit

Permalink
Refactor: only log the logger prefix at trace log level (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm committed Mar 21, 2024
1 parent 6596c13 commit ef0abb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/console/logger.ts
Expand Up @@ -93,7 +93,7 @@ export default class Logger {

const loggerTime = this.logLevel <= LogLevel.TRACE ? `[${moment().format('HH:mm:ss.SSS')}] ` : '';
const levelPrefix = `${chalkFunc(LogLevel[logLevel])}:${' '.repeat(Math.max(5 - LogLevel[logLevel].length, 0))} `;
const loggerPrefix = this.logLevel <= LogLevel.INFO && this.loggerPrefix ? `${this.loggerPrefix}: ` : '';
const loggerPrefix = this.logLevel <= LogLevel.TRACE && this.loggerPrefix ? `${this.loggerPrefix}: ` : '';

return message
.replace(/Error: /, '') // strip `new Error()` prefix
Expand Down

0 comments on commit ef0abb0

Please sign in to comment.