From: Michael Tremer Date: Sat, 30 Sep 2023 11:11:17 +0000 (+0000) Subject: pakfire: Set the default log level to INFO X-Git-Tag: 0.9.30~1594 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe7cfb26f0b9739f6542bf7964517ba9b3ce688d;p=pakfire.git pakfire: Set the default log level to INFO Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 38776c1cd..94f760ccf 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -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