Skip to content

Commit

Permalink
fix(default-reporter): use loglevel to filter deprecation warnings (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
milahu committed Mar 30, 2022
1 parent 732d496 commit 2554a7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/default-reporter/src/reporterForClient/index.ts
Expand Up @@ -74,7 +74,11 @@ export default function (
cwd,
width,
}),
reportDeprecations(log$.deprecation, { cwd, isRecursive: opts.isRecursive }),
reportDeprecations(log$.deprecation, {
cwd,
isRecursive: opts.isRecursive,
logLevel: opts.logLevel,
}),
reportMisc(
log$,
{
Expand Down
Expand Up @@ -4,15 +4,20 @@ import { filter, map } from 'rxjs/operators'
import chalk from 'chalk'
import formatWarn from './utils/formatWarn'
import { zoomOut } from './utils/zooming'
import type { LogLevel } from '@pnpm/logger'

export default (
deprecation$: Rx.Observable<DeprecationLog>,
opts: {
cwd: string
isRecursive: boolean
logLevel?: LogLevel
}
) => {
return deprecation$.pipe(
// print deprecation warnings for all logLevel except error = warn info debug
// TODO unswitch -> return a "null pipe"
filter(() => opts.logLevel != 'error'),
// print warnings only about deprecated packages from the root
filter((log) => log.depth === 0),
map((log) => {
Expand Down

0 comments on commit 2554a7e

Please sign in to comment.