summaryrefslogtreecommitdiffstats
path: root/libmpv
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-20 21:40:47 +0200
committerwm4 <wm4@nowhere>2015-06-20 21:40:47 +0200
commit23b83c6676c17963a59febeac72fdc73a4198769 (patch)
treeac79ca8400a0a7e2c45819fb71362783bb114462 /libmpv
parent34fce974c60177444d23ab1b658545b32046785f (diff)
downloadmpv-23b83c6676c17963a59febeac72fdc73a4198769.tar.bz2
mpv-23b83c6676c17963a59febeac72fdc73a4198769.tar.xz
client API: allow using msg-level option for log messages
Client API users can enable log output with mpv_request_log_messages(). But you can enable only a single log level. This is normally enough, but the --msg-level option (which controls the terminal log level) provides more flexibility. Due to internal complexity, it would be hard to provide the same flexibility for each client API handle. But there's a simple way to achieve basically the same thing: add an option that sends log messages to the API handle, which would also be printed to the terminal as by --msg-level. The only change is that we don't disable this logic if the terminal is disabled. Instead we check for this before the message is output, which in theory can lower performance if messages are being spammed. It could be handled with some more effort, but the gain would be negligible.
Diffstat (limited to 'libmpv')
-rw-r--r--libmpv/client.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpv/client.h b/libmpv/client.h
index 3bfced25ca..54ac421209 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -198,7 +198,7 @@ extern "C" {
* relational operators (<, >, <=, >=).
*/
#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
-#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 18)
+#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 19)
/**
* Return the MPV_CLIENT_API_VERSION the mpv source has been compiled with.
@@ -1418,6 +1418,9 @@ int mpv_request_event(mpv_handle *ctx, mpv_event_id event, int enable);
* @param min_level Minimal log level as string. Valid log levels:
* no fatal error warn info status v debug trace
* The value "no" disables all messages. This is the default.
+ * An exception is the value "terminal-default", which uses the
+ * log level as set by the "--msg-level" option. This works
+ * even if the terminal is disabled. (Since API version 1.19.)
* Also see mpv_log_level.
*/
int mpv_request_log_messages(mpv_handle *ctx, const char *min_level);