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

fix some log noise #195

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

flokli
Copy link

@flokli flokli commented Jun 13, 2024

This downgrades two of the info! level log messages to debug.

They becomes quite noisy if fuse-backend-rs is used as a library. Logging it at debug! keeps them silent until log levels are increased.

flokli added 2 commits June 13, 2024 18:09
This otherwise becomes too noisy when used in another library.
This is too noisy when used as a library, and gets logged once per
thread even.
@imeoer
Copy link
Collaborator

imeoer commented Jun 18, 2024

It make sense, perhaps we can provide these info by other method?

@flokli
Copy link
Author

flokli commented Jun 18, 2024

You mean, you'd be fine to merge this in case there's ways to get out major, minor, capable, enabled as a consumer of the library, so you can log them out there?

If so, any preferences on the API?

major, minor already are constants:

major: KERNEL_VERSION,
minor: KERNEL_MINOR_VERSION,

... and stored in self.vers.

want is coming from the flags in passed by the user (so probably possible to calculate statically). The enabled flags are already available in InitOut, so maybe they can be stored in self too?

@flokli
Copy link
Author

flokli commented Jun 18, 2024

Hmmh, passing these flags up requires touching a lot of things. No code is arguably having a use for these values (otherwise it would have been exposed already), and the only usecase would seems to be logging it to the user (when they're /debugging/ fuse-backend-rs) so I'm thinking increasing the log level in that case is the right call.

The current situation causes every user of the library to get these log statements printed out to their CLI users, even if everything is fine. At least if the binary doesn't do some extra work on explicitly filtering out info log messages for the fuse-backend-rs crate.

Another example: A HTTP client library also doesn't print the source port it uses for the outgoing TCP connection whenever it opens one, at least not in the info/default log level. If users want (and use it in a log framework that allows crate-level log levels), they can crank up the debug level on that specific crate.

@imeoer
Copy link
Collaborator

imeoer commented Jun 18, 2024

Indeed, should avoid output info level logs within a lib, but it's hard to change the log level to debug issue in production, maybe we can store pub capable in self? WDYT cc @jiangliu @bergwolf

@flokli
Copy link
Author

flokli commented Oct 1, 2024

Poke :-) Any chance we can land this?

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 this pull request may close these issues.

2 participants