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

feat: support RAP_LOG environment variable; remove -debug option #59

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

zjp-CN
Copy link
Contributor

@zjp-CN zjp-CN commented Oct 16, 2024

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 and RAP_LOG=WARN cargo +nightly-2024-06-30 rap -F
    截图_20241016082628

  • RAP_LOG=DEBUG cargo +nightly-2024-06-30 rap -F
    截图_20241016082651

e.g.
RAP_LOG=WARN cargo +nightly-2024-06-30 rap -F
RAP_LOG=warn cargo +nightly-2024-06-30 rap -F
@hxuhack
Copy link
Contributor

hxuhack commented Oct 16, 2024

That's really cool. Thanks for your support. @zjp-CN

@hxuhack hxuhack merged commit 90385e2 into Artisan-Lab:main Oct 16, 2024
1 check passed
@zjp-CN zjp-CN deleted the RAP_LOG branch October 16, 2024 00:59
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