diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-20 08:21:36 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-20 08:21:36 +0000 |
| commit | 580098eb4929a3bdbf424af18da361259ef2efe5 (patch) | |
| tree | c6ff77fa55fcbdcdd0ca21ec2105db14a8c050d3 /src/InitiateConnectionCommand.cc | |
| parent | 3940da75624b194cdd5036f9fe330fcecc725964 (diff) | |
2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten Logger interface. Logger now writes source file name and
line number in log file.
Diffstat (limited to 'src/InitiateConnectionCommand.cc')
| -rw-r--r-- | src/InitiateConnectionCommand.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/InitiateConnectionCommand.cc b/src/InitiateConnectionCommand.cc index e58da6c7..ca96d12a 100644 --- a/src/InitiateConnectionCommand.cc +++ b/src/InitiateConnectionCommand.cc @@ -37,6 +37,7 @@ #include "DownloadEngine.h" #include "Option.h" #include "Logger.h" +#include "LogFactory.h" #include "message.h" #include "prefs.h" #include "NameResolver.h" @@ -48,6 +49,7 @@ #include "InitiateConnectionCommandFactory.h" #include "util.h" #include "RecoverableException.h" +#include "fmt.h" namespace aria2 { @@ -56,8 +58,8 @@ InitiateConnectionCommand::InitiateConnectionCommand const SharedHandle<Request>& req, const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, - DownloadEngine* e): - AbstractCommand(cuid, req, fileEntry, requestGroup, e) + DownloadEngine* e) + : AbstractCommand(cuid, req, fileEntry, requestGroup, e) { setTimeout(getOption()->getAsInt(PREF_DNS_TIMEOUT)); // give a chance to be executed in the next loop in DownloadEngine @@ -97,11 +99,10 @@ bool InitiateConnectionCommand::executeInternal() { // TODO ipaddr might not be used if pooled sockt was found. getDownloadEngine()->markBadIPAddress(hostname, ipaddr, port); if(!getDownloadEngine()->findCachedIPAddress(hostname, port).empty()) { - if(getLogger()->info()) { - getLogger()->info(EX_EXCEPTION_CAUGHT, ex); - getLogger()->info(MSG_CONNECT_FAILED_AND_RETRY, - util::itos(getCuid()).c_str(), ipaddr.c_str(), port); - } + A2_LOG_INFO_EX(EX_EXCEPTION_CAUGHT, ex); + A2_LOG_INFO(fmt(MSG_CONNECT_FAILED_AND_RETRY, + util::itos(getCuid()).c_str(), + ipaddr.c_str(), port)); Command* command = InitiateConnectionCommandFactory::createInitiateConnectionCommand (getCuid(), getRequest(), getFileEntry(), getRequestGroup(), |
