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/ClientNew.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 '')
-rw-r--r-- | src/ClientNew.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/ClientNew.cxx b/src/ClientNew.cxx index bc12bbf6a..e7bb6e1c2 100644 --- a/src/ClientNew.cxx +++ b/src/ClientNew.cxx @@ -26,6 +26,7 @@ #include "system/Resolver.hxx" #include "Permission.hxx" #include "util/Error.hxx" +#include "Log.hxx" #include <assert.h> #include <sys/types.h> @@ -40,9 +41,6 @@ #include <tcpd.h> #endif - -#define LOG_LEVEL_SECURE G_LOG_LEVEL_INFO - static const char GREETING[] = "OK MPD " PROTOCOL_VERSION "\n"; Client::Client(EventLoop &_loop, Partition &_partition, @@ -82,9 +80,9 @@ client_new(EventLoop &loop, Partition &partition, if (!hosts_access(&req)) { /* tcp wrappers says no */ - g_log(G_LOG_DOMAIN, LOG_LEVEL_SECURE, - "libwrap refused connection (libwrap=%s) from %s", - progname, hostaddr); + FormatWarning(client_domain, + "libwrap refused connection (libwrap=%s) from %s", + progname, hostaddr); g_free(hostaddr); close_socket(fd); @@ -97,7 +95,7 @@ client_new(EventLoop &loop, Partition &partition, ClientList &client_list = *partition.instance.client_list; if (client_list.IsFull()) { - g_warning("Max Connections Reached!"); + LogWarning(client_domain, "Max connections reached"); close_socket(fd); return; } @@ -110,8 +108,7 @@ client_new(EventLoop &loop, Partition &partition, client_list.Add(*client); remote = sockaddr_to_string(sa, sa_length, IgnoreError()); - g_log(G_LOG_DOMAIN, LOG_LEVEL_SECURE, - "[%u] opened from %s", client->num, remote); + FormatInfo(client_domain, "[%u] opened from %s", client->num, remote); g_free(remote); } @@ -122,6 +119,6 @@ Client::Close() SetExpired(); - g_log(G_LOG_DOMAIN, LOG_LEVEL_SECURE, "[%u] closed", num); + FormatInfo(client_domain, "[%u] closed", num); delete this; } |