From: Daniel Martí Date: Mon, 5 Oct 2015 19:43:08 +0000 (+0200) Subject: Always use the same logging format X-Git-Tag: 0.5.0~53 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=73f9c1d1c2267a373ce45692df3cadcd5cd3f77f;p=fdroidserver.git Always use the same logging format This helps differentiate errors, warnings and regular messages. --- 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")