logging: do not override log_level default val

If user didn't set anything on command line, do not override the default
value of `log_level` specified by the initializer.

This is a bit contraintuitive if a developer sets the value ad hoc to a
different val, it won't take effect.
This commit is contained in:
Martin Pulec
2023-03-07 16:31:00 +01:00
parent 4c114d0b33
commit 20a331fad1

View File

@@ -331,7 +331,7 @@ static bool parse_opts_set_logging(int argc, char *argv[])
}
opterr = saved_opterr;
if (logging_lvl == 0) {
logging_lvl = getenv("ULTRAGRID_VERBOSE") != nullptr ? LOG_LEVEL_VERBOSE : LOG_LEVEL_INFO;
logging_lvl = getenv("ULTRAGRID_VERBOSE") != nullptr ? LOG_LEVEL_VERBOSE : log_level;
} else {
logging_lvl += LOG_LEVEL_INFO;
}