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
loglevel=error
doesn't supress warnings, such as WARN deprecated
and WARN Issues with peer dependencies found
.
#4343
Comments
reportMisc.ts#L12 |
Is there a way to supress warnings while still showing errors? My use case is that I've a examples directory (https://github.com/brillout/vite-plugin-ssr/tree/master/examples):
So ideally I'd supress specific warnings for all/specific examples. I've no control over the dependencies of the examples and therefore warnings are expected. |
same here
no, the condition is LOG_LEVEL_NUMBER[obj.level] <= maxLogLevel default level is
packages/default-reporter/src/reporterForClient/reportMisc.ts// packages/default-reporter/src/reporterForClient/reportMisc.ts
const LOG_LEVEL_NUMBER: Record<LogLevel, number> = {
error: 0,
warn: 1,
info: 2,
debug: 3,
}
export default (
...
) => {
const maxLogLevel = LOG_LEVEL_NUMBER[opts.logLevel ?? 'info'] ?? LOG_LEVEL_NUMBER['info']
const reportWarning = makeWarningReporter(opts)
return Rx.merge(log$.registry, log$.other).pipe(
filter((obj) => LOG_LEVEL_NUMBER[obj.level] <= maxLogLevel &&
(obj.level !== 'info' || !obj['prefix'] || obj['prefix'] === opts.cwd)),
map((obj) => {
switch (obj.level) {
case 'warn': {
return reportWarning(obj)
}
case 'error':
if (obj['prefix'] && obj['prefix'] !== opts.cwd) {
return Rx.of({
msg: `${obj['prefix'] as string}:` + os.EOL + reportError(obj, opts.config),
})
}
return Rx.of({ msg: reportError(obj, opts.config) })
default:
return Rx.of({ msg: obj['message'] })
}
})
)
} this works with the reportDeprecations(log$.deprecation, { cwd, isRecursive: opts.isRecursive }), packages/default-reporter/src/index.ts const deprecationPushStream = new Rx.Subject<logs.DeprecationLog>()
const log$ = {
deprecation: Rx.from(deprecationPushStream), |
pnpm version:
6.30.0
Code to reproduce the issue:
See screenshot. Should be trivial to reproduce, but I can provide a step-by-step reproduction if needed.
Expected behavior:
As per the documentation (https://pnpm.io/npmrc#loglevel), warnings shouldn't be shown.
Actual behavior:
Warnings are displayed.
Additional information:
node -v
prints:v.16.5.0
The text was updated successfully, but these errors were encountered: