Skip to content
Snippets Groups Projects
Commit fb914db1 authored by syuilo's avatar syuilo
Browse files

use date-fns

parent 3a04c66e
No related branches found
No related tags found
No related merge requests found
import * as cluster from 'cluster';
import * as chalk from 'chalk';
import * as dateformat from 'dateformat';
import { format as dateFormat } from 'date-fns';
import { envOption } from '../env';
import config from '@/config/index';
......@@ -57,7 +57,7 @@ export default class Logger {
return;
}
const time = dateformat(new Date(), 'HH:MM:ss');
const time = dateFormat(new Date(), 'HH:mm:ss');
const worker = cluster.isPrimary ? '*' : cluster.worker.id;
const l =
level === 'error' ? important ? chalk.bgRed.white('ERR ') : chalk.red('ERR ') :
......@@ -116,7 +116,7 @@ export default class Logger {
}
public debug(message: string, data?: Record<string, any> | null, important = false): void { // デバッグ用に使う(開発者に必要だが利用者に不要な情報)
if (process.env.NODE_ENV != 'production' || envOption.verbose) {
if (process.env.NODE_ENV !== 'production' || envOption.verbose) {
this.log('debug', message, data, important);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment