From 977a21130ba074eb6d98d260c68028be339bf96d Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Wed, 17 Aug 2022 14:50:49 +0200 Subject: [PATCH] fix(gatsby-cli): preserve verbosity in spawned child processes (#36399) --- packages/gatsby-cli/src/reporter/reporter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/gatsby-cli/src/reporter/reporter.ts b/packages/gatsby-cli/src/reporter/reporter.ts index 49059f45653c8..5913c12942482 100644 --- a/packages/gatsby-cli/src/reporter/reporter.ts +++ b/packages/gatsby-cli/src/reporter/reporter.ts @@ -23,6 +23,7 @@ import { registerAdditionalDiagnosticOutputHandler, AdditionalDiagnosticsOutputHandler, } from "./redux/diagnostics" +import { isTruthy } from "gatsby-core-utils/is-truthy" const errorFormatter = getErrorFormatter() const tracer = globalTracer() @@ -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` @@ -74,6 +75,7 @@ class Reporter { */ setVerbose = (_isVerbose: boolean = true): void => { isVerbose = _isVerbose + process.env.GATSBY_REPORTER_ISVERBOSE = isVerbose ? `1` : `0` } /**