Skip to content

Change logger max level to be set by feature #429

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

Merged
merged 2 commits into from
May 16, 2022

Conversation

JonahPlusPlus
Copy link
Contributor

Resolves #428

By changing log::set_max_level(log::LevelFilter::Info); to log::set_max_level(log::STATIC_MAX_LEVEL);, the max log level can be set by specifying features.

For example, to use info for release and trace for debugging, set features = ["release_max_level_info", "max_level_trace"].

Tested this to work, thought I could just remove that line, but it seems you need to explicitly set it to STATIC_MAX_LEVEL, which is set depending on the features and whether it is a release build.

@GabrielMajeri
Copy link
Collaborator

Thanks for the PR! log::STATIC_MAX_LEVEL sounds like what we should've used from the start.

Removed `log::set_max_level(log::LevelFilter::Info);`
@GabrielMajeri GabrielMajeri changed the title Changed logger max level to be set by feature Change logger max level to be set by feature May 16, 2022
@GabrielMajeri GabrielMajeri merged commit 56e9f86 into rust-osdev:main May 16, 2022
@JonahPlusPlus JonahPlusPlus deleted the logger branch November 18, 2024 15:30
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.

Allow for using trace! and debug! while debugging
2 participants