mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 07:12:39 +00:00
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
a600d152d2
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.
This commit is contained in:
parent
56669fb44e
commit
26ec0e3d46
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user