From: Hans-Christoph Steiner Date: Thu, 14 Dec 2017 19:30:00 +0000 (+0100) Subject: always hide PIL.PngImagePlugin's "STREAM" debug messages X-Git-Tag: 1.0.0~19^2~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=fdroidserver.git;a=commitdiff_plain;h=781e3c785fabcd9c85263f797d187a7350ddc102 always hide PIL.PngImagePlugin's "STREAM" debug messages Otherwise, enabling verbose messages gives tons of these messages: DEBUG: STREAM b'IHDR' 16 13 DEBUG: STREAM b'IDAT' 41 32768 --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 624e9353..8248a944 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -128,6 +128,13 @@ default_config = { def setup_global_opts(parser): + try: # the buildserver VM might not have PIL installed + from PIL import PngImagePlugin + logger = logging.getLogger(PngImagePlugin.__name__) + logger.setLevel(logging.INFO) # tame the "STREAM" debug messages + except ImportError: + pass + parser.add_argument("-v", "--verbose", action="store_true", default=False, help=_("Spew out even more information than normal")) parser.add_argument("-q", "--quiet", action="store_true", default=False,