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

[Bug?]: yarn 4 logFilters is unable to filter most messages #6221

Open
1 task
ssbarnea opened this issue Apr 11, 2024 · 1 comment
Open
1 task

[Bug?]: yarn 4 logFilters is unable to filter most messages #6221

ssbarnea opened this issue Apr 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ssbarnea
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

Despite logFilters being documented as a way to tune the verbosity of yarn, it seems that most of the filtering does not function at all and the messages are still displayed.

I even used alternatives ways like using pattern, still no way to get rid of messages like the ones seen in the output.

# .yarnrc.yml
yarnPath: .yarn/releases/yarn-4.1.1.cjs
logFilters:
  - code: YN0000
    level: discard
$ yarn
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 41ms

To reproduce

  • yarn init -2
  • edit .yarnrc.yml to add some filter
  • run yarn, see that filtering does not happen

Environment

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 20.6.1 - /private/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T/xfs-ec7f8757/node
    Yarn: 4.1.1 - /private/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T/xfs-ec7f8757/yarn
    npm: 10.3.0 - ~/.asdf/plugins/nodejs/shims/npm

Additional context

Sample repository to demonstrate the bug at https://github.com/ssbarnea/bug-yarn

@ssbarnea ssbarnea added the bug Something isn't working label Apr 11, 2024
@rally25rs
Copy link
Contributor

It looks like this was built into the original logFilters work:
(YN0000 is MessageName.UNNAMED)
https://github.com/yarnpkg/berry/pull/1907/files#diff-05cad9b7b804b027f333df2ab2a9abded894b7364d43b6e3a17d9e4d24a8e1a1R314-R315

And might have been intentional, based on: #1907 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants