tweag / topiary

https://topiary.tweag.io/
MIT License
580 stars 29 forks source link

Expose logging level via a CLI flag #603

Closed Xophmeister closed 1 year ago

Xophmeister commented 1 year ago

Currently the logging level is exposed through the default env_logger environment variable RUST_LOG, which has poor discoverability. I propose the following:

  1. Expose the logging level through a CLI "verbosity" flag. The "usual" way of doing this is with -v, where more vs means more verbosity. (It looks like there is an off-the-shelf option for this, for clap.)

  2. Rather than RUST_LOG, we should use TOPIARY_LOG and document this better in the README.

:bulb: This issue depends on #583.

Xophmeister commented 1 year ago

clap-verbosity-flag also adds a --quiet option which, for our purposes, is both unnecessary and its short option conflicts with our short option for --query. It's very simple to roll our own...

Xophmeister commented 1 year ago

env_logger doesn't allow both (1) and (2) simultaneously, so I've stuck with (1)...