From efe2c50524f653b99a7369ae2fc7b98993f008e3 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 20 Feb 2023 10:53:42 -0700 Subject: [PATCH] fix: logToStderr actually logs to stderr --- src/command.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command.ts b/src/command.ts index 54c1aaf79..6c99f3e43 100644 --- a/src/command.ts +++ b/src/command.ts @@ -27,7 +27,7 @@ import {CommandError} from './interfaces/errors' import {boolean} from './flags' import {requireJson} from './util' import {PJSON} from './interfaces' -import {stdout} from './cli-ux/stream' +import {stdout, stderr} from './cli-ux/stream' const pjson = requireJson(__dirname, '..', 'package.json') @@ -255,7 +255,7 @@ export abstract class Command { public logToStderr(message = '', ...args: any[]): void { if (!this.jsonEnabled()) { message = typeof message === 'string' ? message : inspect(message) - stdout.write(format(message, ...args) + '\n') + stderr.write(format(message, ...args) + '\n') } }