summaryrefslogtreecommitdiffstats
path: root/src/Net
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-30 22:28:33 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-30 22:28:33 +0200
commit1a43fad56dc945c72a4ab711d2c9ff6d1a5a1502 (patch)
treee2b6847ce5e6a6d41269f1d2fa30011060abcd08 /src/Net
parent241f1947580df7f905ed3d6969cc3a6a4bb99f5a (diff)
downloadmad-1a43fad56dc945c72a4ab711d2c9ff6d1a5a1502.tar
mad-1a43fad56dc945c72a4ab711d2c9ff6d1a5a1502.zip
Added Format class for improved logging experience :)
Diffstat (limited to 'src/Net')
-rw-r--r--src/Net/Connection.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Net/Connection.cpp b/src/Net/Connection.cpp
index f66a3df..ace771f 100644
--- a/src/Net/Connection.cpp
+++ b/src/Net/Connection.cpp
@@ -35,7 +35,7 @@ Connection::~Connection() {
void Connection::handleHandshake(const boost::system::error_code& error) {
if(error) {
- application->logf(Core::Logger::LOG_NETWORK, "Error: %s", error.message().c_str());
+ application->log(Core::Logger::LOG_NETWORK, Core::Format("Error: %1%") % error.message());
// TODO Error handling
doDisconnect();
@@ -64,7 +64,7 @@ void Connection::handleShutdown(const boost::system::error_code& error) {
boost::lock_guard<boost::shared_mutex> lock(connectionLock);
if(error) {
- application->logf(Core::Logger::LOG_NETWORK, Core::Logger::LOG_VERBOSE, "Shutdown error: %s", error.message().c_str());
+ application->log(Core::Logger::LOG_NETWORK, Core::Logger::LOG_VERBOSE, Core::Format("Shutdown error: %1%") % error.message());
}
_setState(DISCONNECTED);
@@ -121,7 +121,7 @@ void Connection::handleRead(const boost::system::error_code& error, std::size_t
if(error == boost::system::errc::operation_canceled)
return;
- application->logf(Core::Logger::LOG_NETWORK, "Read error: %s", error.message().c_str());
+ application->log(Core::Logger::LOG_NETWORK, Core::Format("Read error: %1%") % error.message());
// TODO Error
doDisconnect();
@@ -182,7 +182,7 @@ void Connection::rawReceive(std::size_t length, const boost::function1<void, con
void Connection::handleWrite(const boost::system::error_code& error, std::size_t) {
if(error)
- application->logf(Core::Logger::LOG_NETWORK, Core::Logger::LOG_VERBOSE, "Write error: %s", error.message().c_str());
+ application->log(Core::Logger::LOG_NETWORK, Core::Logger::LOG_VERBOSE, Core::Format("Write error: %1%") % error.message());
{
boost::unique_lock<boost::shared_mutex> lock(connectionLock);