From ba1943ac00ed20a568270f8930811c1eac08f66a Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 28 Sep 2017 11:53:57 +0200 Subject: msg: reinterpret a bunch of message levels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've decided that MP_TRACE means “noisy spam per frame”, whereas MP_DBG just means “more verbose debugging messages than MSGL_V”. Basically, MSGL_DBG shouldn't create spam per frame like it currently does, and MSGL_V should make sense to the end-user and provide mostly additional informational output. MP_DBG is basically what I want to make the new default for --log-file, so the cut-off point for MP_DBG is if we probably want to know if for debugging purposes but the user most likely doesn't care about on the terminal. Also, the debug callbacks for libass and ffmpeg got bumped in their verbosity levels slightly, because being external components they're a bit less relevant to mpv debugging, and a bit too over-eager in what they consider to be relevant information. I exclusively used the "try it on my machine and remove messages from MSGL_* until it does what I want it to" approach of refactoring, so YMMV. --- options/m_config.c | 8 ++++---- options/path.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'options') diff --git a/options/m_config.c b/options/m_config.c index 9a18cde26f..6f22fd50c5 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -900,8 +900,8 @@ int m_config_set_option_cli(struct m_config *config, struct bstr name, goto done; if (r == 2) { - MP_VERBOSE(config, "Setting option '%.*s' = '%.*s' (flags = %d)\n", - BSTR_P(name), BSTR_P(param), flags); + MP_DBG(config, "Setting option '%.*s' = '%.*s' (flags = %d)\n", + BSTR_P(name), BSTR_P(param), flags); } union m_option_value val = {0}; @@ -952,8 +952,8 @@ int m_config_set_option_node(struct m_config *config, bstr name, if (mp_msg_test(config->log, MSGL_V)) { char *s = m_option_type_node.print(NULL, data); - MP_VERBOSE(config, "Setting option '%.*s' = %s (flags = %d) -> %d\n", - BSTR_P(name), s ? s : "?", flags, r); + MP_DBG(config, "Setting option '%.*s' = %s (flags = %d) -> %d\n", + BSTR_P(name), s ? s : "?", flags, r); talloc_free(s); } diff --git a/options/path.c b/options/path.c index 5248a1d75b..dac9238cf9 100644 --- a/options/path.c +++ b/options/path.c @@ -98,7 +98,7 @@ char *mp_find_user_config_file(void *talloc_ctx, struct mpv_global *global, if (res) res = mp_path_join(talloc_ctx, res, filename); talloc_free(tmp); - MP_VERBOSE(global, "config path: '%s' -> '%s'\n", filename, res ? res : "-"); + MP_DBG(global, "config path: '%s' -> '%s'\n", filename, res ? res : "-"); return res; } @@ -119,12 +119,12 @@ static char **mp_find_all_config_files_limited(void *talloc_ctx, char *file = mp_path_join_bstr(ret, bstr0(dir), fn); if (mp_path_exists(file)) { - MP_VERBOSE(global, "config path: '%.*s' -> '%s'\n", - BSTR_P(fn), file); + MP_DBG(global, "config path: '%.*s' -> '%s'\n", + BSTR_P(fn), file); MP_TARRAY_APPEND(NULL, ret, num_ret, file); } else { - MP_VERBOSE(global, "config path: '%.*s' -/-> '%s'\n", - BSTR_P(fn), file); + MP_DBG(global, "config path: '%.*s' -/-> '%s'\n", + BSTR_P(fn), file); } } } @@ -189,7 +189,7 @@ char *mp_get_user_path(void *talloc_ctx, struct mpv_global *global, } if (!res) res = talloc_strdup(talloc_ctx, path); - MP_VERBOSE(global, "user path: '%s' -> '%s'\n", path, res); + MP_DBG(global, "user path: '%s' -> '%s'\n", path, res); return res; } -- cgit v1.2.3