diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-02-03 13:51:24 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-02-03 13:51:24 +0900 |
| commit | 0bd0fb9fbfd0b05c84e826ebb34d252444725c01 (patch) | |
| tree | 10ecacb840dcac8b839f2a037b8c1c807cbbf77f /src | |
| parent | Make more importance for env log (diff) | |
| download | misskey-0bd0fb9fbfd0b05c84e826ebb34d252444725c01.tar.gz misskey-0bd0fb9fbfd0b05c84e826ebb34d252444725c01.tar.bz2 misskey-0bd0fb9fbfd0b05c84e826ebb34d252444725c01.zip | |
Include worker information for each logs
Diffstat (limited to 'src')
| -rw-r--r-- | src/misc/logger.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/misc/logger.ts b/src/misc/logger.ts index bfdb48c646..5440edab74 100644 --- a/src/misc/logger.ts +++ b/src/misc/logger.ts @@ -1,3 +1,4 @@ +import * as cluster from 'cluster'; import chalk from 'chalk'; import * as dateformat from 'dateformat'; @@ -23,7 +24,8 @@ export default class Logger { this.parentLogger.log(level, `[${domain}]\t${message}`, important); } else { const time = dateformat(new Date(), 'HH:MM:ss'); - const log = `${chalk.gray(time)} ${level} [${domain}]\t${message}`; + const process = cluster.isMaster ? '*' : cluster.worker.id; + const log = `${chalk.gray(time)} ${level} ${process}\t[${domain}]\t${message}`; console.log(important ? chalk.bold(log) : log); } } |