From c16910519959796caa06da179154a738715d5ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 19 Jul 2023 15:38:58 +0200 Subject: [PATCH] #1041: added new option --noLogColors for output in vscode extension --- lib/cli.js | 4 ++++ lib/index.js | 1 + lib/util/util.js | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 3778c6233..b12914767 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -564,6 +564,10 @@ yargs type: 'boolean', description: 'Only output errors to CLI', }) + .option('noLogColors', { + type: 'boolean', + description: 'do not use color codes in CLI log output', + }) .option('noLogFile', { type: 'boolean', description: 'Only output log to CLI but not to files', diff --git a/lib/index.js b/lib/index.js index 84edbe6a6..772ed9020 100644 --- a/lib/index.js +++ b/lib/index.js @@ -59,6 +59,7 @@ class Mcdev { 'fromRetrieve', 'json', 'like', + 'noLogColors', 'noLogFile', 'refresh', 'schedule', diff --git a/lib/util/util.js b/lib/util/util.js index 787812b99..315fcd1b1 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -249,7 +249,9 @@ const Util = { // Write logs to Console level: Util.OPTIONS.loggerLevel || 'info', format: winston.format.combine( - winston.format.colorize(), + Util.OPTIONS.noLogColors + ? winston.format.uncolorize() + : winston.format.colorize(), winston.format.timestamp({ format: 'HH:mm:ss' }), winston.format.simple(), winston.format.printf(