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

telemetry: make logger verbosity public #11

Merged

Conversation

evanrittenhouse
Copy link
Contributor

@evanrittenhouse evanrittenhouse commented Feb 2, 2024

I'm using slog-stdlog to read Quiche logs from Foundations, but I want to be able to configure the level of logs they emit. To do so, slog-stdlog exposes an init_with_level method - we obviously then need to get the verbosity level for the current logger.

I didn't see anything that lets us do this, as Context::current_log() just gets us a SharedLog which doesn't expose verbosity/LoggerSettings - if there's an easier way, please feel free to decline this PR.

@evanrittenhouse evanrittenhouse changed the title Add a get_verbosity() function Add a get_verbosity() function for Loggers Feb 2, 2024
@Noah-Kennedy
Copy link
Collaborator

You're failing a clippy check, can you remove the .clone() since this type is Copy?

Just amend the old commit right now since we can't squash on the reviewers side atm.

@Noah-Kennedy Noah-Kennedy self-requested a review February 2, 2024 17:45
foundations/src/telemetry/log/mod.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@Noah-Kennedy Noah-Kennedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

foundations/src/telemetry/log/mod.rs Outdated Show resolved Hide resolved
@evanrittenhouse evanrittenhouse changed the title Add a get_verbosity() function for Loggers telemetry: make logger verbosity public Feb 2, 2024
@Noah-Kennedy Noah-Kennedy merged commit 8fa8a51 into cloudflare:main Feb 2, 2024
14 checks passed
@evanrittenhouse evanrittenhouse deleted the evanrittenhouse/get_verbosity branch February 2, 2024 18:20
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.

3 participants