Skip to content

Commit

Permalink
fix(gatsby-cli): preserve verbosity in spawned child processes (gatsb…
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh authored Aug 17, 2022
1 parent 03157e8 commit 977a211
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby-cli/src/reporter/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
registerAdditionalDiagnosticOutputHandler,
AdditionalDiagnosticsOutputHandler,
} from "./redux/diagnostics"
import { isTruthy } from "gatsby-core-utils/is-truthy"

const errorFormatter = getErrorFormatter()
const tracer = globalTracer()
Expand All @@ -35,7 +36,7 @@ export interface IActivityArgs {
tags?: { [key: string]: any }
}

let isVerbose = false
let isVerbose = isTruthy(process.env.GATSBY_REPORTER_ISVERBOSE)

function isLogIntentMessage(msg: any): msg is ILogIntent {
return msg && msg.type === `LOG_INTENT`
Expand Down Expand Up @@ -74,6 +75,7 @@ class Reporter {
*/
setVerbose = (_isVerbose: boolean = true): void => {
isVerbose = _isVerbose
process.env.GATSBY_REPORTER_ISVERBOSE = isVerbose ? `1` : `0`
}

/**
Expand Down

0 comments on commit 977a211

Please sign in to comment.