From 5a3fb0f96a29666ef3ce698b76d49c1c1178a7f6 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 24 Oct 2024 15:59:09 -0500 Subject: Add a `--loglevel` argument to select loglevel in scripts To enable selection of log levels within scripts, this commit adds the `--loglevel` argument to the list of arguments that can be passed to scripts. --- scripts/cli_parser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/cli_parser.py b/scripts/cli_parser.py index 308ee4b..d42ae66 100644 --- a/scripts/cli_parser.py +++ b/scripts/cli_parser.py @@ -19,6 +19,12 @@ def init_cli_parser(program: str, description: Optional[str] = None) -> Argument type=int, default=86400, help="How long to keep any redis keys around.") + parser.add_argument( + "--loglevel", + type=str, + default="INFO", + choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], + help="The severity of events to track with the logger.") return parser def add_global_data_arguments(parser: ArgumentParser) -> ArgumentParser: -- cgit v1.2.3