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

Log: Add option to set LevelFilter at compile time #53

Merged

Conversation

jschwe
Copy link
Contributor

@jschwe jschwe commented May 17, 2020

Adds support to change the LevelFilter of the logger at compile time via enviroment variable HERMIT_LOG_LEVEL_FILTER.
If the Environment variable is not set, or the name doesn't match, then LevelFilter::Info is used by default, which is the same as it was before.
The name of the Environment variable is arbitrary of course, so feel free to suggest other names.

If the Environment variable HERMIT_LOG_LEVEL_FILTER is set at compile time to a string matching the Name of a Levelfilter enum value, then that value is used for the Levelfilter.
If the Environment variable is not set, or the name doesn't match, then LevelFilter::Info is used by default, which is the same as it was before.
@jschwe jschwe force-pushed the feature/set-loglevel-at-compile-time branch from a211556 to 329a0a8 Compare May 17, 2020 08:54
@stlankes
Copy link
Contributor

Ah, option_env is new for my. Great feature!

@stlankes stlankes merged commit 5f8697b into hermit-os:master May 17, 2020
@jschwe jschwe deleted the feature/set-loglevel-at-compile-time branch May 17, 2020 17:53
simonschoening pushed a commit to simonschoening/libhermit-rs that referenced this pull request Aug 26, 2021
If the Environment variable HERMIT_LOG_LEVEL_FILTER is set at compile time to a string matching the Name of a Levelfilter enum value, then that value is used for the Levelfilter.
If the Environment variable is not set, or the name doesn't match, then LevelFilter::Info is used by default, which is the same as it was before.
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