summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-18 00:44:12 +0100
committerwm4 <wm4@nowhere>2019-11-18 00:44:54 +0100
commit8c2d73f112055a9e52e5bda4934c2ac90e31def7 (patch)
treeb8d768872784e18981197dabf2639a839ba77dad /player/main.c
parent8e5642ff6872d94faf69c6305acdcfd788ddebba (diff)
downloadmpv-8c2d73f112055a9e52e5bda4934c2ac90e31def7.tar.bz2
mpv-8c2d73f112055a9e52e5bda4934c2ac90e31def7.tar.xz
player: remove mechanisms for better logging with repl.lua
As preparation for making repl.lua part of the core (maybe), add some mechanisms which are supposed to improve its behavior. Add a silent mode. Calling mpv_request_log_messages() with the log level name prefixed with "silent:" will disable logging from the API user's perspective. But it will keep the log buffer, and record new messages, without returning them to the user. If logging is enabled again by requesting the same log level without "silent:" prefix, the buffered log messages are returned to the user at once. This is not documented, because it's far too messy and special as that I'd want anyone to rely on this behavior, but it will be perfectly fine for an internal script. Another thing is that we record early startup messages. The goal is to make the repl.lua script show option and config parsing file errors. This works only with the special "terminal-default" log level. In addition, reduce the "terminal-default" capacity to only 100 log messages. If this is going to be enabled by default, it shouldn't use too much resources.
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c
index b6c9e1085d..d633871399 100644
--- a/player/main.c
+++ b/player/main.c
@@ -345,6 +345,7 @@ int mp_initialize(struct MPContext *mpctx, char **options)
}
mp_init_paths(mpctx->global, opts);
+ mp_msg_set_early_logging(mpctx->global, true);
mp_update_logging(mpctx, true);
if (options) {