Skip to content

Commit

Permalink
fix: logToStderr actually logs to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Feb 20, 2023
1 parent 7de57d0 commit efe2c50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<PJSON>(__dirname, '..', 'package.json')

Expand Down Expand Up @@ -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')
}
}

Expand Down

0 comments on commit efe2c50

Please sign in to comment.