From c5d4e30e240840b93daf8a72b818534bb5685897 Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Tue, 16 Oct 2018 11:24:28 +0100 Subject: [PATCH] logger: Add logs logging function Signed-off-by: Cameron Diver --- lib/utils/logger.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/utils/logger.ts b/lib/utils/logger.ts index eec22b9a..d86e0545 100644 --- a/lib/utils/logger.ts +++ b/lib/utils/logger.ts @@ -11,6 +11,7 @@ class Logger { success: NodeJS.ReadWriteStream; warn: NodeJS.ReadWriteStream; error: NodeJS.ReadWriteStream; + logs: NodeJS.ReadWriteStream; }; public formatMessage: (name: string, message: string) => string; @@ -23,6 +24,7 @@ class Logger { logger.addPrefix('success', chalk.green('[Success]')); logger.addPrefix('warn', chalk.yellow('[Warn]')); logger.addPrefix('error', chalk.red('[Error]')); + logger.addPrefix('logs', chalk.green('[Logs]')); this.streams = { build: logger.createLogStream('build'), @@ -31,6 +33,7 @@ class Logger { success: logger.createLogStream('success'), warn: logger.createLogStream('warn'), error: logger.createLogStream('error'), + logs: logger.createLogStream('logs'), }; _.forEach(this.streams, function(stream, key) { @@ -65,6 +68,10 @@ class Logger { logBuild(msg: string) { return this.streams.build.write(msg + eol); } + + logLogs(msg: string) { + return this.streams.logs.write(msg + eol); + } } export = Logger;