From 7b7ec0340fc38f8d7ccdb2a1f4b1de41e2ca5455 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Thu, 29 Dec 2016 18:07:37 +0900 Subject: [PATCH] Show time --- src/utils/logger.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 01c3fdc76a..de4ac65812 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -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}`); }