From eba5d025d2ba682de358b792dd15e80529d6a0f1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Dec 2013 21:41:18 +0100 Subject: msg: convert defines to enum Also get rid of MSGL_HINT and the many MSGL_DBG* levels. --- common/msg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'common/msg.c') diff --git a/common/msg.c b/common/msg.c index 8563cadc65..3a6f3a14e3 100644 --- a/common/msg.c +++ b/common/msg.c @@ -114,6 +114,7 @@ static void update_loglevel(struct mp_log *log) pthread_mutex_unlock(&mp_msg_lock); } +// Return whether the message at this verbosity level would be actually printed. bool mp_msg_test_log(struct mp_log *log, int lev) { if (mp_msg_mute || !log->root) @@ -136,7 +137,7 @@ static int mp_msg_docolor(void) static void set_msg_color(FILE* stream, int lev) { - static const int v_colors[] = {9, 1, 3, 3, -1, -1, 2, 8, 8, 8, 9}; + static const int v_colors[] = {9, 1, 3, -1, -1, 2, 8, 8, -1}; if (mp_msg_docolor()) terminal_set_foreground_color(stream, v_colors[lev]); } @@ -272,8 +273,8 @@ static const char *level_names[] = { [MSGL_INFO] = "info", [MSGL_STATUS] = "status", [MSGL_V] = "v", - [MSGL_DBG2] = "debug", - [MSGL_DBG5] = "trace", + [MSGL_DEBUG] = "debug", + [MSGL_TRACE] = "trace", }; int mp_msg_split_msglevel(struct bstr *s, struct bstr *out_mod, int *out_level) -- cgit v1.2.3