Ignore stdout errors when running from console

This commit is contained in:
Fedor Indutny 2024-11-18 10:25:17 -08:00 committed by GitHub
parent 757b237186
commit e4aa4de5e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,7 @@ import { CircularBuffer } from 'cirbuf';
import type { BrowserWindow } from 'electron';
import { app, ipcMain as ipc } from 'electron';
import readFirstLine from 'firstline';
import { filter, flatten, map, pick, sortBy } from 'lodash';
import { filter, flatten, map, noop, pick, sortBy } from 'lodash';
import {
createReadStream,
mkdirSync,
@ -100,6 +100,8 @@ export async function initialize(
streams.push({ stream: rotatingStream });
if (isRunningFromConsole) {
process.stdout.on('error', noop);
streams.push({
level: 'debug' as const,
stream: process.stdout,