]> git.ipfire.org Git - pakfire.git/commitdiff
daemon: Log to the console when in debug mode
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 26 Jan 2025 16:26:31 +0000 (16:26 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 26 Jan 2025 16:26:31 +0000 (16:26 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/cli/pakfire-daemon.c

index a02a372c6ed1ffe6922c62674a5d2dfaa3386847..9ca414cf16b42ab3ea58a839b9b0ea4bb4bb74da 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <pakfire/ctx.h>
 #include <pakfire/daemon.h>
+#include <pakfire/logging.h>
 
 #include "lib/command.h"
 #include "lib/daemon.h"
@@ -45,7 +46,11 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) {
 
        switch (key) {
                case OPT_DEBUG:
+                       // Set the log level to DEBUG
                        pakfire_ctx_set_log_level(ctx, LOG_DEBUG);
+
+                       // Write logs to the console
+                       pakfire_ctx_set_log_callback(ctx, pakfire_log_stderr, NULL);
                        break;
 
                default: