Skip to content

Add support of dynamic log level #94

Answered by tisonkun
zuston asked this question in Q&A
Discussion options

You must be logged in to vote

temporarily adjust the log level to print out some logs for digging

For this purpose, in our use case, we typically use the RUST_LOG env to enable debug level logs, like:

RUST_LOG="debug" ./your/app
# or 
RUST_LOG="info,specific_mod=debug" ./your/app

This follows the most common used env_filter

If you'd like to use more dynamic rules, you can use the CustomFilter for define your rules, and even with a global state to check so that you can modify it at runtime.

I'm glad to hear your concrete use case and see if we can integrate it at the upstream.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tisonkun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #86 on January 10, 2025 16:32.