diff options
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -22,6 +22,7 @@ #include "conf.h" #include "utils.h" #include "fd_util.h" +#include "mpd_error.h" #include <assert.h> #include <sys/types.h> @@ -60,9 +61,9 @@ static void redirect_logs(int fd) { assert(fd >= 0); if (dup2(fd, STDOUT_FILENO) < 0) - g_error("problems dup2 stdout : %s\n", strerror(errno)); + MPD_ERROR("problems dup2 stdout : %s\n", strerror(errno)); if (dup2(fd, STDERR_FILENO) < 0) - g_error("problems dup2 stderr : %s\n", strerror(errno)); + MPD_ERROR("problems dup2 stderr : %s\n", strerror(errno)); } static const char *log_date(void) @@ -138,8 +139,8 @@ log_init_file(const char *path, unsigned line) out_filename = path; out_fd = open_log_file(); if (out_fd < 0) - g_error("problem opening log file \"%s\" (config line %u) for " - "writing\n", path, line); + MPD_ERROR("problem opening log file \"%s\" (config line %u) " + "for writing\n", path, line); g_log_set_default_handler(file_log_func, NULL); } @@ -216,8 +217,8 @@ parse_log_level(const char *value, unsigned line) else if (0 == strcmp(value, "verbose")) return G_LOG_LEVEL_DEBUG; else { - g_error("unknown log level \"%s\" at line %u\n", - value, line); + MPD_ERROR("unknown log level \"%s\" at line %u\n", + value, line); return G_LOG_LEVEL_MESSAGE; } } @@ -252,8 +253,8 @@ void log_init(bool verbose, bool use_stdout) available) */ log_init_syslog(); #else - g_error("config parameter \"%s\" not found\n", - CONF_LOG_FILE); + MPD_ERROR("config parameter \"%s\" not found\n", + CONF_LOG_FILE); #endif #ifdef HAVE_SYSLOG } else if (strcmp(param->value, "syslog") == 0) { |