Show time

This commit is contained in:
Aya Morisawa 2016-12-29 18:07:37 +09:00
parent 212282e8f6
commit c66d0ed496

View File

@ -12,5 +12,6 @@ function toLevelColor(level: LogLevel): chalk.ChalkStyle {
export function log(level: LogLevel, message: string): void {
let color = toLevelColor(level);
console.log(`[${color.bold(level.toUpperCase())}] ${message}`);
let time = (new Date()).toLocaleTimeString([], { hour12: false });
console.log(`[${time} ${color.bold(level.toUpperCase())}]: ${message}`);
}