From 26ec0e3d46a75b48d10b0dd99162e456d8a9dba8 Mon Sep 17 00:00:00 2001 From: der richter Date: Sun, 21 Feb 2021 14:11:22 +0100 Subject: [PATCH] msg: fix really-quiet option to only affect terminal output if log-file and really-quiet options were used together it could lead to a completely empty log-file. this is unexpected because we need the log-file option to work in all cases and produces at least a log of verbosity -v -v. this is a regression of commit a600d152d21ef398eb72b008ee3fe266696eb638 move the really quiet check back up, so it's set before the evaluation of the actual log level, where check for log file, terminal, etc take place. --- common/msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/msg.c b/common/msg.c index 7e271d1b8b..81c7f654f3 100644 --- a/common/msg.c +++ b/common/msg.c @@ -126,6 +126,8 @@ static void update_loglevel(struct mp_log *log) struct mp_log_root *root = log->root; pthread_mutex_lock(&root->lock); log->level = MSGL_STATUS + root->verbose; // default log level + if (root->really_quiet) + log->level = -1; for (int n = 0; root->msg_levels && root->msg_levels[n * 2 + 0]; n++) { if (match_mod(log->verbose_prefix, root->msg_levels[n * 2 + 0])) log->level = mp_msg_find_level(root->msg_levels[n * 2 + 1]); @@ -143,8 +145,6 @@ static void update_loglevel(struct mp_log *log) if (log->root->stats_file) log->level = MPMAX(log->level, MSGL_STATS); log->level = MPMIN(log->level, log->max_level); - if (root->really_quiet) - log->level = -1; atomic_store(&log->reload_counter, atomic_load(&log->root->reload_counter)); pthread_mutex_unlock(&root->lock); }