Skip to content

Commit

Permalink
fix: pipe unwanted logs to /dev/null
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanosdev committed Apr 27, 2024
1 parent f1f4c6b commit be8a4aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/pic/src/pocket-ic-server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChildProcess, spawn } from 'node:child_process';
import { resolve } from 'node:path';
import { chmodSync } from 'node:fs';
import { chmodSync, createWriteStream } from 'node:fs';
import {
BinNotFoundError,
BinStartError,
Expand Down Expand Up @@ -74,10 +74,12 @@ export class PocketIcServer {

if (options.showRuntimeLogs) {
serverProcess.stdout.pipe(process.stdout);
} else {
serverProcess.stdout.pipe(createWriteStream('/dev/null'));
}

if (options.showCanisterLogs) {
serverProcess.stderr.pipe(process.stderr);
serverProcess.stderr.pipe(createWriteStream('/dev/null'));
}

serverProcess.on('error', error => {
Expand Down

0 comments on commit be8a4aa

Please sign in to comment.