feat: support RAP_LOG
environment variable; remove -debug
option
#59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed here,
RAP_LOG
is supported in this PR to dynamically set log level.If RAP_LOG is not set, the default level is info as before.
I also remove -debug option because it'd be better to expose single way via RAP_LOG to set up the log level. The option now is equivalent to
RAP_LOG=DEBUG
.The value on RAP_LOG is case-insensitive, which is defined in LevelFilter::from_str.
Verbosity
is also removed, because there is no reason to use it now.Some tests:
cargo +nightly-2024-06-30 rap -F
andRAP_LOG=WARN cargo +nightly-2024-06-30 rap -F
RAP_LOG=DEBUG cargo +nightly-2024-06-30 rap -F