Skip to content

Enable user configuration of verbosity via log level  #114

@sadielbartholomew

Description

@sadielbartholomew

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions