]> git.ipfire.org Git - pakfire.git/commitdiff
logging: Send debug messages to Python, too
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Jun 2021 13:40:28 +0000 (13:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Jun 2021 13:40:28 +0000 (13:40 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c
src/pakfire/logger.py

index 6a58e561f3d1397f6f49ba8820241e3b2ca6d68b..bb89ac6470dbbbe98ef3393957ba96215d19a5e9 100644 (file)
@@ -61,6 +61,10 @@ static void Pakfire_logging_callback(void* data, int priority, const char* file,
 
        // Translate priority to Python logging priorities
        switch (priority) {
+               case LOG_DEBUG:
+                       priority = 10;
+                       break;
+
                case LOG_INFO:
                        priority = 20;
                        break;
index 92ac94d154e5b040f9b3040c274fa0721462ea7f..6b089742092d8def070412e2bd686ca62d70b355 100644 (file)
@@ -55,7 +55,7 @@ class ConsoleHandler(logging.Handler):
                        msg = self.format(record)
 
                        # Select output file
-                       if record.levelno >= logging.ERROR:
+                       if record.levelno == logging.DEBUG or record.levelno >= logging.ERROR:
                                fd = sys.stderr
                        else:
                                fd = sys.stdout