summaryrefslogtreecommitdiffstats
path: root/common/msg.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-21 21:41:18 +0100
committerwm4 <wm4@nowhere>2013-12-21 22:13:04 +0100
commiteba5d025d2ba682de358b792dd15e80529d6a0f1 (patch)
treeb4617680bce71ff4a44f113e967b3b5bbc651520 /common/msg.c
parent3fa584e2800fff5850e67a4018597cb707d9cc0b (diff)
downloadmpv-eba5d025d2ba682de358b792dd15e80529d6a0f1.tar.bz2
mpv-eba5d025d2ba682de358b792dd15e80529d6a0f1.tar.xz
msg: convert defines to enum
Also get rid of MSGL_HINT and the many MSGL_DBG* levels.
Diffstat (limited to 'common/msg.c')
-rw-r--r--common/msg.c7
1 files changed, 4 insertions, 3 deletions
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)