From 73f9c1d1c2267a373ce45692df3cadcd5cd3f77f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Mon, 5 Oct 2015 21:43:08 +0200 Subject: [PATCH] Always use the same logging format This helps differentiate errors, warnings and regular messages. --- fdroid | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fdroid b/fdroid index 9199ee65..ef3a001a 100755 --- a/fdroid +++ b/fdroid @@ -99,12 +99,15 @@ def main(): verbose = any(s in sys.argv for s in ['-v', '--verbose']) quiet = any(s in sys.argv for s in ['-q', '--quiet']) + # Helpful to differentiate warnings from errors even when on quiet + logformat = '%(levelname)s: %(message)s' + loglevel = logging.INFO if verbose: - logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG) + loglevel = logging.DEBUG elif quiet: - logging.basicConfig(format='%(message)s', level=logging.WARN) - else: - logging.basicConfig(format='%(message)s', level=logging.INFO) + loglevel = logging.WARN + + logging.basicConfig(format=logformat, level=loglevel) if verbose and quiet: logging.critical("Specifying --verbose and --quiet and the same time is silly") -- 2.30.2