diff options
author | Max Kellermann <max@duempel.org> | 2013-09-27 22:31:24 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-02 08:57:55 +0200 |
commit | 060814daa83f6a94f5934464ae42a406c5c7e947 (patch) | |
tree | f636ec6cdbb8e52fda6db987d2a28fc73c7b94b4 /src/system/FatalError.cxx | |
parent | c53492a76a8a05825e1c7f699c05645eee891199 (diff) | |
download | mpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.gz mpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.xz mpd-060814daa83f6a94f5934464ae42a406c5c7e947.zip |
Log: new logging library API
Prepare to migrate away from GLib. Currently, we're still using GLib
as a backend.
Diffstat (limited to 'src/system/FatalError.cxx')
-rw-r--r-- | src/system/FatalError.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/system/FatalError.cxx b/src/system/FatalError.cxx index 7c0dc942a..1cf4ec851 100644 --- a/src/system/FatalError.cxx +++ b/src/system/FatalError.cxx @@ -20,6 +20,8 @@ #include "config.h" #include "FatalError.hxx" #include "util/Error.hxx" +#include "util/Domain.hxx" +#include "LogV.hxx" #include <glib.h> @@ -33,13 +35,12 @@ #include <errno.h> #endif -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "FatalError" +static constexpr Domain fatal_error_domain("fatal_error"); void FatalError(const char *msg) { - g_critical("%s", msg); + LogError(fatal_error_domain, msg); exit(EXIT_FAILURE); } @@ -48,7 +49,7 @@ FormatFatalError(const char *fmt, ...) { va_list ap; va_start(ap, fmt); - g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, fmt, ap); + LogFormatV(fatal_error_domain, LogLevel::ERROR, fmt, ap); va_end(ap); exit(EXIT_FAILURE); @@ -88,7 +89,7 @@ FatalSystemError(const char *msg) system_error = g_strerror(errno); #endif - g_critical("%s: %s", msg, system_error); + FormatError(fatal_error_domain, "%s: %s", msg, system_error); exit(EXIT_FAILURE); } |