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/FileAllocationCommand.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/FileAllocationCommand.cc')
| -rw-r--r-- | src/FileAllocationCommand.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/FileAllocationCommand.cc b/src/FileAllocationCommand.cc index a0b9a296..3373d784 100644 --- a/src/FileAllocationCommand.cc +++ b/src/FileAllocationCommand.cc @@ -38,6 +38,7 @@ #include "DownloadEngine.h" #include "RequestGroup.h" #include "Logger.h" +#include "LogFactory.h" #include "message.h" #include "prefs.h" #include "util.h" @@ -47,6 +48,7 @@ #include "RecoverableException.h" #include "wallclock.h" #include "RequestGroupMan.h" +#include "fmt.h" namespace aria2 { @@ -66,12 +68,10 @@ bool FileAllocationCommand::executeInternal() } fileAllocationEntry_->allocateChunk(); if(fileAllocationEntry_->finished()) { - if(getLogger()->debug()) { - getLogger()->debug - (MSG_ALLOCATION_COMPLETED, - static_cast<long int>(timer_.difference(global::wallclock)), - util::itos(getRequestGroup()->getTotalLength(), true).c_str()); - } + A2_LOG_DEBUG + (fmt(MSG_ALLOCATION_COMPLETED, + static_cast<long int>(timer_.difference(global::wallclock)), + util::itos(getRequestGroup()->getTotalLength(), true).c_str())); getDownloadEngine()->getFileAllocationMan()->dropPickedEntry(); std::vector<Command*>* commands = new std::vector<Command*>(); @@ -90,11 +90,13 @@ bool FileAllocationCommand::executeInternal() bool FileAllocationCommand::handleException(Exception& e) { getDownloadEngine()->getFileAllocationMan()->dropPickedEntry(); - getLogger()->error - (MSG_FILE_ALLOCATION_FAILURE, e, util::itos(getCuid()).c_str()); - getLogger()->error - (MSG_DOWNLOAD_NOT_COMPLETE, util::itos(getCuid()).c_str(), - getRequestGroup()->getDownloadContext()->getBasePath().c_str()); + A2_LOG_ERROR_EX(fmt(MSG_FILE_ALLOCATION_FAILURE, + util::itos(getCuid()).c_str()), + e); + A2_LOG_ERROR + (fmt(MSG_DOWNLOAD_NOT_COMPLETE, + util::itos(getCuid()).c_str(), + getRequestGroup()->getDownloadContext()->getBasePath().c_str())); return true; } |
