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

Use event filter #925

Merged
merged 2 commits into from
Sep 16, 2024
Merged

Use event filter #925

merged 2 commits into from
Sep 16, 2024

Conversation

bassmanitram
Copy link
Contributor

@bassmanitram bassmanitram commented Sep 16, 2024

📬 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

  • I confirm that I've ran cargo +nightly fmt.
  • I confirm that I've ran cargo clippy --fix.
  • I confirm that I've made a best effort attempt to update all relevant documentation.
  • I confirm that my contribution is made under the terms of the Apache 2.0 license.

Martin Bartlett added 2 commits September 16, 2024 16:38
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`.
Copy link
Contributor

@calavera calavera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@calavera calavera merged commit 20206d7 into awslabs:main Sep 16, 2024
7 checks passed
@bassmanitram bassmanitram deleted the use-event-filter branch October 9, 2024 12:36
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