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

Move #warn calls from Kernel to Logger #572

Closed
AlexB52 opened this issue Nov 29, 2023 · 6 comments
Closed

Move #warn calls from Kernel to Logger #572

AlexB52 opened this issue Nov 29, 2023 · 6 comments

Comments

@AlexB52
Copy link
Contributor

AlexB52 commented Nov 29, 2023

I'm looking to silence the Symlink error.

** ERROR: directory is already being watched! **

Directory: %s

is already being watched through: %s

MORE INFO: #{README_URL}

People have mentioned you can monkey patch Listen::Record::SymlinkDetector class: rails/webpacker#1990

I see that logger has a warn level that can be set, but some warn messages are made by Kernel

kernel warn references:

Are there specific reasons for using Kernel#warn instead of Logger#warn?
Can we move the calls from Kernel to Logger?

@LouisaNikita
Copy link

LouisaNikita commented Nov 29, 2023 via email

@ColinDKelley
Copy link
Collaborator

ColinDKelley commented Feb 22, 2024

Are there specific reasons for using Kernel#warn instead of Logger#warn?

Well, they are different in that Kernel.warn will go to STDERR vs the log file. So it's probably more likely that Kernel.warn will be seen?

I notice the code is using Kernel.warn whereas it could equally just call warn which would wind up in Kernel#warn (the base class method). That's probably preferred. Would it help any?

I wonder if we should make this warning explicitly disablable?

ColinDKelley added a commit to Invoca/listen that referenced this issue Feb 22, 2024
ColinDKelley added a commit to Invoca/listen that referenced this issue Feb 22, 2024
@ColinDKelley
Copy link
Collaborator

@AlexB52 How does this approach look? #579

@AlexB52
Copy link
Contributor Author

AlexB52 commented Feb 22, 2024

@ColinDKelley
That went from no flexibility to maximum flexibility that's awesome.
The configuration to switch from :warn to :log to :silent is a nice touch and looks really handy.
Thank you

It seems that people having this issue will be able to configure listen in a rails initializer too right?

@ColinDKelley
Copy link
Collaborator

@AlexB52 Thanks! That style of configuration was an inspiration from Rails configs that work like that. Let's keep the discussion happening over on that PR.

@ColinDKelley
Copy link
Collaborator

Resolved in v3.9.0. See README for documentation.

AlexB52 added a commit to AlexB52/retest that referenced this issue Feb 25, 2024
AlexB52 added a commit to AlexB52/retest that referenced this issue Feb 25, 2024
AlexB52 added a commit to AlexB52/retest that referenced this issue Feb 25, 2024
AlexB52 added a commit to AlexB52/retest that referenced this issue Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants