From 2904891c24d9b0d5ce6022c5175845cd8bc50d44 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Tue, 26 Feb 2019 08:42:16 +0100 Subject: cli: Support debug logging --- gemato/cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gemato/cli.py b/gemato/cli.py index 15e46ad..04ada3b 100644 --- a/gemato/cli.py +++ b/gemato/cli.py @@ -1,6 +1,6 @@ # gemato: CLI routines # vim:fileencoding=utf-8 -# (c) 2017-2018 Michał Górny +# (c) 2017-2019 Michał Górny # Licensed under the terms of 2-clause BSD license from __future__ import print_function @@ -51,14 +51,16 @@ class GematoCommand(object): """ Add options specific to the command to subparser @subp. """ - pass + subp.add_argument('--debug', action='store_true', + help='Enable debugging output') def parse_args(self, args, argp): """ Process command-line arguments @args. @argp is the argparse instance provided for error reporting. """ - pass + if args.debug: + logging.getLogger().setLevel(logging.DEBUG) def __call__(self): """ -- cgit v1.2.3