mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
fix: don't show info messages on --loglevel=error (#9241)
This commit is contained in:
6
.changeset/smooth-tips-love.md
Normal file
6
.changeset/smooth-tips-love.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/default-reporter": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't show info output when `--loglevel=error` is used.
|
||||
@@ -82,13 +82,6 @@ export function reporterForClient (
|
||||
: undefined
|
||||
|
||||
const outputs: Array<Rx.Observable<Rx.Observable<{ msg: string }>>> = [
|
||||
reportLifecycleScripts(log$, {
|
||||
appendOnly: (opts.appendOnly === true || opts.streamLifecycleOutput) && !opts.hideLifecycleOutput,
|
||||
aggregateOutput: opts.aggregateOutput,
|
||||
hideLifecyclePrefix: opts.hideLifecyclePrefix,
|
||||
cwd,
|
||||
width,
|
||||
}),
|
||||
reportMisc(
|
||||
log$,
|
||||
{
|
||||
@@ -100,25 +93,12 @@ export function reporterForClient (
|
||||
peerDependencyRules: opts.peerDependencyRules,
|
||||
}
|
||||
),
|
||||
reportInstallChecks(log$.installCheck, { cwd }),
|
||||
reportScope(log$.scope, { isRecursive: opts.isRecursive, cmd: opts.cmd }),
|
||||
reportSkippedOptionalDependencies(log$.skippedOptionalDependency, { cwd }),
|
||||
reportHooks(log$.hook, { cwd, isRecursive: opts.isRecursive }),
|
||||
reportUpdateCheck(log$.updateCheck, opts),
|
||||
]
|
||||
|
||||
if (opts.cmd !== 'dlx') {
|
||||
outputs.push(reportContext(log$, { cwd }))
|
||||
}
|
||||
|
||||
// logLevelNumber: 0123 = error warn info debug
|
||||
const logLevelNumber = LOG_LEVEL_NUMBER[opts.logLevel ?? 'info'] ?? LOG_LEVEL_NUMBER['info']
|
||||
const showInfo = logLevelNumber >= LOG_LEVEL_NUMBER.info
|
||||
|
||||
if (opts.cmd in PRINT_EXECUTION_TIME_IN_COMMANDS && showInfo) {
|
||||
outputs.push(reportExecutionTime(log$.executionTime))
|
||||
}
|
||||
|
||||
if (logLevelNumber >= LOG_LEVEL_NUMBER.warn) {
|
||||
outputs.push(
|
||||
reportPeerDependencyIssues(log$, opts.peerDependencyRules),
|
||||
@@ -131,7 +111,25 @@ export function reporterForClient (
|
||||
}
|
||||
|
||||
if (showInfo) {
|
||||
if (opts.cmd in PRINT_EXECUTION_TIME_IN_COMMANDS) {
|
||||
outputs.push(reportExecutionTime(log$.executionTime))
|
||||
}
|
||||
if (opts.cmd !== 'dlx') {
|
||||
outputs.push(reportContext(log$, { cwd }))
|
||||
}
|
||||
outputs.push(
|
||||
reportLifecycleScripts(log$, {
|
||||
appendOnly: (opts.appendOnly === true || opts.streamLifecycleOutput) && !opts.hideLifecycleOutput,
|
||||
aggregateOutput: opts.aggregateOutput,
|
||||
hideLifecyclePrefix: opts.hideLifecyclePrefix,
|
||||
cwd,
|
||||
width,
|
||||
}),
|
||||
reportInstallChecks(log$.installCheck, { cwd }),
|
||||
reportScope(log$.scope, { isRecursive: opts.isRecursive, cmd: opts.cmd }),
|
||||
reportSkippedOptionalDependencies(log$.skippedOptionalDependency, { cwd }),
|
||||
reportHooks(log$.hook, { cwd, isRecursive: opts.isRecursive }),
|
||||
reportUpdateCheck(log$.updateCheck, opts),
|
||||
reportProgress(log$, {
|
||||
cwd,
|
||||
throttle,
|
||||
@@ -146,20 +144,18 @@ export function reporterForClient (
|
||||
hideProgressPrefix: opts.hideProgressPrefix,
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (!opts.appendOnly && showInfo) {
|
||||
outputs.push(reportBigTarballProgress(log$))
|
||||
}
|
||||
|
||||
if (!opts.isRecursive && showInfo) {
|
||||
outputs.push(reportSummary(log$, {
|
||||
cmd: opts.cmd,
|
||||
cwd,
|
||||
env: opts.env,
|
||||
filterPkgsDiff: opts.filterPkgsDiff,
|
||||
pnpmConfig: opts.pnpmConfig,
|
||||
}))
|
||||
if (!opts.appendOnly) {
|
||||
outputs.push(reportBigTarballProgress(log$))
|
||||
}
|
||||
if (!opts.isRecursive) {
|
||||
outputs.push(reportSummary(log$, {
|
||||
cmd: opts.cmd,
|
||||
cwd,
|
||||
env: opts.env,
|
||||
filterPkgsDiff: opts.filterPkgsDiff,
|
||||
pnpmConfig: opts.pnpmConfig,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
return outputs
|
||||
|
||||
Reference in New Issue
Block a user