デフォルトでログのタイムスタンプ非表示

This commit is contained in:
syuilo 2019-02-07 10:51:50 +09:00
parent cef8aa5e7a
commit 1d2c50fc26
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 3 additions and 1 deletions

View file

@ -28,7 +28,8 @@ export default class Logger {
} else {
const time = dateformat(new Date(), 'HH:MM:ss');
const process = cluster.isMaster ? '*' : cluster.worker.id;
const log = `${chalk.gray(time)} ${level} ${process}\t[${domains.join(' ')}]\t${message}`;
let log = `${level} ${process}\t[${domains.join(' ')}]\t${message}`;
if (program.withLogTime) log = chalk.gray(time) + ' ' + log;
console.log(important ? chalk.bold(log) : log);
}
}