Artisan-Lab / RAP

Rust Analysis Platform
39 stars 14 forks source link

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

Closed zjp-CN closed 1 month ago

zjp-CN commented 1 month ago

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:

hxuhack commented 1 month ago

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