Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gatsby): Respect VERBOSE env var #29708

Merged
merged 4 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/gatsby/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ import {
markWebpackStatusAsPending,
markWebpackStatusAsDone,
} from "../utils/webpack-status"
import { updateSiteMetadata } from "gatsby-core-utils"
import { updateSiteMetadata, isTruthy } from "gatsby-core-utils"

module.exports = async function build(program: IBuildArgs): Promise<void> {
report.setVerbose(program.verbose)
report.setVerbose(isTruthy(process.env.VERBOSE) || program.verbose)

if (program.profile) {
report.warn(
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/src/commands/develop-process.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { syncStaticDir } from "../utils/get-static-dir"
import reporter from "gatsby-cli/lib/reporter"
import chalk from "chalk"
import telemetry from "gatsby-telemetry"
import { isTruthy } from "gatsby-core-utils"
import express from "express"
import inspector from "inspector"
import { initTracer } from "../utils/tracer"
Expand Down Expand Up @@ -80,7 +80,7 @@ const openDebuggerPort = (debugInfo: IDebugInfo): void => {
}

module.exports = async (program: IDevelopArgs): Promise<void> => {
reporter.setVerbose(program.verbose)
reporter.setVerbose(isTruthy(process.env.VERBOSE) || program.verbose)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that this isn't complete - we should set program.vebose to true if env var is truthy because of things like

if (program.verbose) {
logTransitions(service)
}
which check if (program.verbose) before doing some potentially expensive things


if (program.debugInfo) {
openDebuggerPort(program.debugInfo)
Expand Down