GreenScheduler / cats

CATS: the Climate-Aware Task Scheduler :cat2: :tiger2: :leopard:
https://greenscheduler.github.io/cats/
MIT License
50 stars 8 forks source link

Enable user configuration of verbosity via log level #114

Open sadielbartholomew opened 2 weeks ago

sadielbartholomew commented 2 weeks ago

We have a logging system set up for CATS, but (based on what I can see from a git grep "log" in the repo root) there is no interface by which a user can change the log level to adapt the verbosity of output using that system. Therefore, given the Python default logging level set (we don't appear to specify otherwise) of 'WARNING', only log messages at 'WARNING', 'ERROR' or 'CRITICAL' level will currently emerge, not anything on 'INFO' or 'DEBUG', though we do include a few log messages under the former category.

We should implement a means to change the verbosity through configuration of the log level. I suggest one of two options for a new CLI argument to control this:

  1. A --verbosity/-v and two-fold -v -v option to move to logging.info and logging.debug level (i.e. messages at that log level and above emerge) instead of the logging.warning default, respectively (-v/--verbose is quite common among routine commands);
  2. --logging N to set the log level to N, either with its integer or string identifier (this is probably a less common interface to control verbosity, but definitely used in some cases e.g. with the ncdump command, and more flexible in a concise way).
abhidg commented 2 weeks ago

I like -v and -vv to set info and debug!