aboutsummaryrefslogtreecommitdiffstats
path: root/src/ZeroconfBonjour.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-27 22:31:24 +0200
committerMax Kellermann <max@duempel.org>2013-10-02 08:57:55 +0200
commit060814daa83f6a94f5934464ae42a406c5c7e947 (patch)
treef636ec6cdbb8e52fda6db987d2a28fc73c7b94b4 /src/ZeroconfBonjour.cxx
parentc53492a76a8a05825e1c7f699c05645eee891199 (diff)
downloadmpd-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 '')
-rw-r--r--src/ZeroconfBonjour.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ZeroconfBonjour.cxx b/src/ZeroconfBonjour.cxx
index b77154e1b..215391b76 100644
--- a/src/ZeroconfBonjour.cxx
+++ b/src/ZeroconfBonjour.cxx
@@ -22,14 +22,15 @@
#include "ZeroconfInternal.hxx"
#include "Listen.hxx"
#include "event/SocketMonitor.hxx"
+#include "util/Domain.hxx"
+#include "Log.hxx"
#include "gcc.h"
#include <glib.h>
#include <dns_sd.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "bonjour"
+static constexpr Domain bonjour_domain("bonjour");
class BonjourMonitor final : public SocketMonitor {
DNSServiceRef service_ref;
@@ -64,11 +65,14 @@ dnsRegisterCallback(gcc_unused DNSServiceRef sdRef,
gcc_unused void *context)
{
if (errorCode != kDNSServiceErr_NoError) {
- g_warning("Failed to register zeroconf service.");
+ LogError(bonjour_domain,
+ "Failed to register zeroconf service");
bonjour_monitor->Cancel();
} else {
- g_debug("Registered zeroconf service with name '%s'", name);
+ FormatDebug(bonjour_domain,
+ "Registered zeroconf service with name '%s'",
+ name);
}
}
@@ -85,7 +89,8 @@ BonjourInit(EventLoop &loop, const char *service_name)
NULL);
if (error != kDNSServiceErr_NoError) {
- g_warning("Failed to register zeroconf service.");
+ LogError(bonjour_domain,
+ "Failed to register zeroconf service");
if (dnsReference) {
DNSServiceRefDeallocate(dnsReference);