Only log to console if process.stdout is available

This commit is contained in:
Josh Perez 2021-09-16 10:33:17 -04:00 committed by GitHub
parent 20be8a11fe
commit a5f44bc46c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -340,7 +340,7 @@ function logAtLevel(level: LogLevel, ...args: ReadonlyArray<unknown>) {
if (globalLogger) {
const levelString = getLogLevelString(level);
globalLogger[levelString](cleanArgs(args));
} else if (isRunningFromConsole) {
} else if (isRunningFromConsole && !process.stdout.destroyed) {
console._log(...args);
}
}