diff options
Diffstat (limited to 'src/socket')
-rw-r--r-- | src/socket/Socket.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/socket/Socket.cpp b/src/socket/Socket.cpp index daeb6fa2..9c2a050c 100644 --- a/src/socket/Socket.cpp +++ b/src/socket/Socket.cpp @@ -29,7 +29,7 @@ #include "Socket.hpp" -#define LOG(s) s << "[Socket] " +#define LOG(s) (s("[Socket] ")) namespace Ingen { namespace Socket { @@ -96,8 +96,8 @@ Socket::set_addr(const std::string& uri) struct addrinfo* ainfo; int st = 0; if ((st = getaddrinfo(host.c_str(), port.c_str(), NULL, &ainfo))) { - LOG(Raul::error) << "Error in getaddrinfo: " - << gai_strerror(st) << std::endl; + LOG(Raul::error)(Raul::fmt("Error in getaddrinfo: %1%\n") + % gai_strerror(st)); return false; } @@ -117,8 +117,8 @@ Socket::bind(const std::string& uri) return true; } - LOG(Raul::error) << "Failed to bind " << _uri - << ": " << strerror(errno) << std::endl; + LOG(Raul::error)(Raul::fmt("Failed to bind <%1%> (%2%)\n") + % _uri % strerror(errno)); return false; } @@ -129,8 +129,8 @@ Socket::connect(const std::string& uri) return true; } - LOG(Raul::error) << "Failed to connect " << _uri - << ": " << strerror(errno) << std::endl; + LOG(Raul::error)(Raul::fmt("Failed to connect <%1%> (%2%)\n") + % _uri % strerror(errno)); return false; } @@ -138,10 +138,10 @@ bool Socket::listen() { if (::listen(_sock, 64) == -1) { - LOG(Raul::error) << "Failed to listen on " << _uri << std::endl; + LOG(Raul::error)(Raul::fmt("Failed to listen on %1%\n") % _uri); return false; } else { - LOG(Raul::info) << "Listening on " << _uri << std::endl; + LOG(Raul::info)(Raul::fmt("Listening on %1%\n") % _uri); return true; } } @@ -155,8 +155,8 @@ Socket::accept() int conn = ::accept(_sock, client_addr, &client_addr_len); if (conn == -1) { - LOG(Raul::error) << "Error accepting connection: " - << strerror(errno) << std::endl; + LOG(Raul::error)(Raul::fmt("Error accepting connection: %1%\n") + % strerror(errno)); return SharedPtr<Socket>(); } |