From 580098eb4929a3bdbf424af18da361259ef2efe5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 20 Nov 2010 08:21:36 +0000 Subject: 2010-11-20 Tatsuhiro Tsujikawa Rewritten Logger interface. Logger now writes source file name and line number in log file. --- src/HttpServerBodyCommand.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/HttpServerBodyCommand.cc') diff --git a/src/HttpServerBodyCommand.cc b/src/HttpServerBodyCommand.cc index 7246ef16..441ed40b 100644 --- a/src/HttpServerBodyCommand.cc +++ b/src/HttpServerBodyCommand.cc @@ -38,6 +38,7 @@ #include "HttpServer.h" #include "HttpHeader.h" #include "Logger.h" +#include "LogFactory.h" #include "RequestGroup.h" #include "RequestGroupMan.h" #include "RecoverableException.h" @@ -51,6 +52,7 @@ #include "XmlRpcResponse.h" #include "wallclock.h" #include "util.h" +#include "fmt.h" namespace aria2 { @@ -58,11 +60,11 @@ HttpServerBodyCommand::HttpServerBodyCommand (cuid_t cuid, const SharedHandle& httpServer, DownloadEngine* e, - const SharedHandle& socket): - Command(cuid), - e_(e), - socket_(socket), - httpServer_(httpServer) + const SharedHandle& socket) + : Command(cuid), + e_(e), + socket_(socket), + httpServer_(httpServer) { setStatus(Command::STATUS_ONESHOT_REALTIME); e_->addSocketForReadCheck(socket_, this); @@ -108,7 +110,7 @@ bool HttpServerBodyCommand::execute() } } else { if(timeoutTimer_.difference(global::wallclock) >= 30) { - getLogger()->info("HTTP request body timeout."); + A2_LOG_INFO("HTTP request body timeout."); return true; } else { e_->addCommand(this); @@ -116,11 +118,10 @@ bool HttpServerBodyCommand::execute() } } } catch(RecoverableException& e) { - if(getLogger()->info()) { - getLogger()->info - ("CUID#%s - Error occurred while reading HTTP request body", - e, util::itos(getCuid()).c_str()); - } + A2_LOG_INFO_EX + (fmt("CUID#%s - Error occurred while reading HTTP request body", + util::itos(getCuid()).c_str()), + e); return true; } -- cgit