Skip to content

Conversation

@InnocentusLime
Copy link
Contributor

One of possible use-cases for Filter would be using it as as CLI argument, so the user can configure the logger without setting any environment variables. Right now it is not possible to use Filter as a CLI argument in the clap crate, because clap requires all CLI arguments to implement Clone.

Passing Filter through CLI can be especially useful on Windows, because there is no way (in either cmd or Powershell) to set an environment variable just for a command invocation like in bash. E.g.

# Possible in bash, but not in Powershell
RUST_LOG="mod1=warn,mod2=info" ./my_envlogger_app

One of possible use-cases for Filter would be using it as a CLI argument,
so the user can configure the logger without setting any environment
variables. Right now it isn't possible to use Filter as a CLI argument
in clap, because clap requires all CLI arguments to implement Clone.
@epage epage merged commit 20f89b8 into rust-cli:main Oct 13, 2025
14 of 15 checks passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18447261517

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 43.5%

Totals Coverage Status
Change from base Build 18167002462: 0.0%
Covered Lines: 261
Relevant Lines: 600

💛 - Coveralls

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.

3 participants