From a5f44bc46c40e87b4fb2a5d777e9b171c4ed34cb Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Thu, 16 Sep 2021 10:33:17 -0400 Subject: [PATCH] Only log to console if process.stdout is available --- ts/logging/main_process_logging.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/logging/main_process_logging.ts b/ts/logging/main_process_logging.ts index ada2a0762138..3706d2673b8f 100644 --- a/ts/logging/main_process_logging.ts +++ b/ts/logging/main_process_logging.ts @@ -340,7 +340,7 @@ function logAtLevel(level: LogLevel, ...args: ReadonlyArray) { if (globalLogger) { const levelString = getLogLevelString(level); globalLogger[levelString](cleanArgs(args)); - } else if (isRunningFromConsole) { + } else if (isRunningFromConsole && !process.stdout.destroyed) { console._log(...args); } }