diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-02-03 16:45:13 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-02-03 16:45:13 +0900 |
| commit | 75558add17a14142d51205f20a2f535fc91f3a34 (patch) | |
| tree | ce1c529a87905c831b14a56ab2913430dde18805 /src/misc | |
| parent | Revert "Revert "Merge pull request #4098 from syuilo/dependabot/npm_and_yarn/... (diff) | |
| download | sharkey-75558add17a14142d51205f20a2f535fc91f3a34.tar.gz sharkey-75558add17a14142d51205f20a2f535fc91f3a34.tar.bz2 sharkey-75558add17a14142d51205f20a2f535fc91f3a34.zip | |
Better logging
Diffstat (limited to 'src/misc')
| -rw-r--r-- | src/misc/logger.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/misc/logger.ts b/src/misc/logger.ts index 5440edab74..8fbff9638d 100644 --- a/src/misc/logger.ts +++ b/src/misc/logger.ts @@ -31,19 +31,24 @@ export default class Logger { } public error(message: string | Error): void { // 実行を継続できない状況で使う - this.log(chalk.red.bold('ERROR'), chalk.red.bold(message.toString())); + this.log(chalk.red('ERR '), chalk.red(message.toString())); } public warn(message: string, important = false): void { // 実行を継続できるが改善すべき状況で使う - this.log(chalk.yellow.bold('WARN'), chalk.yellow.bold(message), important); + this.log(chalk.yellow('WARN'), chalk.yellow(message), important); } public succ(message: string, important = false): void { // 何かに成功した状況で使う - this.log(chalk.blue.green('DONE'), chalk.green.bold(message), important); + this.log(chalk.green('DONE'), chalk.green(message), important); } public info(message: string, important = false): void { // それ以外 - this.log(chalk.blue.bold('INFO'), message, important); + this.log(chalk.blue('INFO'), message, important); } + public debug(message: string, important = false): void { // デバッグ用に使う + if (process.env.NODE_ENV != 'production') { + this.log(chalk.gray('VERB'), chalk.gray(message), important); + } + } } |