summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/options.rst7
-rw-r--r--common/msg.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 85b5418323..8b1bc8c3d8 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -403,8 +403,9 @@ Program Behavior
``--log-file=<path>``
Opens the given path for writing, and print log messages to it. Existing
- files will be truncated. The log level always corresponds to ``-v``,
- regardless of terminal verbosity levels.
+ files will be truncated. The log level is at least ``-v``, but can be
+ raised via ``--msg-level`` (the option cannot lower it below the forced
+ minimum log level).
``--config-dir=<path>``
Force a different configuration directory. If this is set, the given
@@ -3380,6 +3381,8 @@ Terminal
can use the module names printed in the output (prefixed to each line in
``[...]``) to limit the output to interesting modules.
+ This also affects ``--log-file``, and in certain cases libmpv API logging.
+
.. note::
Some messages are printed before the command line is parsed and are
diff --git a/common/msg.c b/common/msg.c
index 375eff9aad..c8190106cd 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -285,7 +285,7 @@ static void write_log_file(struct mp_log *log, int lev, char *text)
{
struct mp_log_root *root = log->root;
- if (lev > MSGL_V || !root->log_file)
+ if (!root->log_file || lev > MPMAX(MSGL_V, log->terminal_level))
return;
fprintf(root->log_file, "[%8.3f][%c][%s] %s",