chiark / gitweb /
always hide PIL.PngImagePlugin's "STREAM" debug messages
authorHans-Christoph Steiner <hans@eds.org>
Thu, 14 Dec 2017 19:30:00 +0000 (20:30 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 20 Dec 2017 22:46:37 +0000 (23:46 +0100)
Otherwise, enabling verbose messages gives tons of these messages:
DEBUG: STREAM b'IHDR' 16 13
DEBUG: STREAM b'IDAT' 41 32768

fdroidserver/common.py

index 624e93538d9d0de01dfb2561d94154fe4d3c2c2b..8248a9441349f3c06b87eb66f0706db7ed7a8dee 100644 (file)
@@ -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,