summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/lua.c13
-rw-r--r--player/lua/defaults.lua2
2 files changed, 3 insertions, 12 deletions
diff --git a/player/lua.c b/player/lua.c
index 5aae0a4b7f..a9aebf90ca 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -258,20 +258,11 @@ static void kill_script(struct script_ctx *ctx)
talloc_free(ctx);
}
-static const char *log_level[] = {
- [MSGL_FATAL] = "fatal",
- [MSGL_ERR] = "error",
- [MSGL_WARN] = "warn",
- [MSGL_INFO] = "info",
- [MSGL_V] = "verbose",
- [MSGL_DEBUG] = "debug",
-};
-
static int check_loglevel(lua_State *L, int arg)
{
const char *level = luaL_checkstring(L, arg);
- for (int n = 0; n < MP_ARRAY_SIZE(log_level); n++) {
- if (log_level[n] && strcasecmp(log_level[n], level) == 0)
+ for (int n = 0; n < MSGL_MAX; n++) {
+ if (mp_log_levels[n] && strcasecmp(mp_log_levels[n], level) == 0)
return n;
}
luaL_error(L, "Invalid log level '%s'", level);
diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua
index d24cda9cbe..4b5e5e6126 100644
--- a/player/lua/defaults.lua
+++ b/player/lua/defaults.lua
@@ -70,7 +70,7 @@ mp.msg = {
error = function(...) return mp.log("error", ...) end,
warn = function(...) return mp.log("warn", ...) end,
info = function(...) return mp.log("info", ...) end,
- verbose = function(...) return mp.log("verbose", ...) end,
+ verbose = function(...) return mp.log("v", ...) end,
debug = function(...) return mp.log("debug", ...) end,
}