awslabs / aws-lambda-rust-runtime

A Rust runtime for AWS Lambda
Apache License 2.0
3.36k stars 343 forks source link

Use event filter #925

Closed bassmanitram closed 2 months ago

bassmanitram commented 2 months ago

📬 Issue #, if available:

✍️ Description of changes: Originally a Level was parsed from one of two environment variables (or defaulted) and then converted into a LevelFilter before initializing the subscriber.

However, this precludes using RUST_LOG=off since Level does not recognize that as valid, resulting in Level::INFO (the default) being used.

LevelFilter (to which the above is converted anyway) does allow the value to be off - so it seems a little more flexible (and very very minutely faster) to parse the env var, or default value, directly into a LevelFilter.

🔏 By submitting this pull request