]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Set the default log level to INFO
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Sep 2023 11:11:17 +0000 (11:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Sep 2023 11:11:17 +0000 (11:11 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index 38776c1cd81de9fac7f822754fd305434c1393e6..94f760ccf2da651afd1f85b60734d6291523e754 100644 (file)
@@ -892,6 +892,7 @@ PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, const char* path,
                const char* arch, FILE* conf, int flags, pakfire_log_callback log_callback, void* log_data) {
        char tempdir[PATH_MAX] = PAKFIRE_TMP_DIR "/pakfire-root-XXXXXX";
        char private_dir[PATH_MAX];
+       const char* env = NULL;
        int r = 1;
 
        // Reset pakfire pointer
@@ -919,10 +920,12 @@ PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, const char* path,
                pakfire_log_set_priority(p, LOG_DEBUG);
 
        // Otherwise take the log level from the environment
+       } else if ((env = secure_getenv("PAKFIRE_LOG"))) {
+               pakfire_log_set_priority(p, log_priority(env));
+
+       // Otherwise set the log level to INFO
        } else {
-               const char* env = secure_getenv("PAKFIRE_LOG");
-               if (env)
-                       pakfire_log_set_priority(p, log_priority(env));
+               pakfire_log_set_priority(p, LOG_INFO);
        }
 
        // Store the nominal architecture