aboutsummaryrefslogtreecommitdiffstats
path: root/src/log.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-21 20:13:00 +0100
committerMax Kellermann <max@duempel.org>2008-11-21 20:13:00 +0100
commit0243e1e26debfc9c0034c54dd56b9e3701404b0e (patch)
treec40a98feb6153c5289484b2a048630953025f3bc /src/log.c
parent1c0c583216c3fd7dd638f504bc32d2cb0a7b2f95 (diff)
downloadmpd-0243e1e26debfc9c0034c54dd56b9e3701404b0e.tar.gz
mpd-0243e1e26debfc9c0034c54dd56b9e3701404b0e.tar.xz
mpd-0243e1e26debfc9c0034c54dd56b9e3701404b0e.zip
log: print the log_domain
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/log.c b/src/log.c
index 350b57769..4681a4a3b 100644
--- a/src/log.c
+++ b/src/log.c
@@ -67,7 +67,7 @@ static const char *log_date(void)
}
static void
-mpd_log_func(G_GNUC_UNUSED const gchar *log_domain,
+mpd_log_func(const gchar *log_domain,
G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
{
@@ -87,8 +87,12 @@ mpd_log_func(G_GNUC_UNUSED const gchar *log_domain,
} else
converted = NULL;
- fprintf(file, "%s%s",
+ if (log_domain == NULL)
+ log_domain = "";
+
+ fprintf(file, "%s%s%s%s",
stdout_mode ? "" : log_date(),
+ log_domain, *log_domain == 0 ? "" : ": ",
message);
g_free(converted);