summaryrefslogtreecommitdiff
path: root/src/DHTGetPeersCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-20 08:21:36 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-20 08:21:36 +0000
commit580098eb4929a3bdbf424af18da361259ef2efe5 (patch)
treec6ff77fa55fcbdcdd0ca21ec2105db14a8c050d3 /src/DHTGetPeersCommand.cc
parent3940da75624b194cdd5036f9fe330fcecc725964 (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/DHTGetPeersCommand.cc')
-rw-r--r--src/DHTGetPeersCommand.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/DHTGetPeersCommand.cc b/src/DHTGetPeersCommand.cc
index f48a6149..96e2a3e5 100644
--- a/src/DHTGetPeersCommand.cc
+++ b/src/DHTGetPeersCommand.cc
@@ -44,20 +44,23 @@
#include "PeerStorage.h"
#include "Peer.h"
#include "Logger.h"
+#include "LogFactory.h"
#include "bittorrent_helper.h"
#include "DownloadContext.h"
#include "wallclock.h"
+#include "fmt.h"
namespace aria2 {
-DHTGetPeersCommand::DHTGetPeersCommand(cuid_t cuid,
- RequestGroup* requestGroup,
- DownloadEngine* e):
- Command(cuid),
- requestGroup_(requestGroup),
- e_(e),
- numRetry_(0),
- lastGetPeerTime_(0)
+DHTGetPeersCommand::DHTGetPeersCommand
+(cuid_t cuid,
+ RequestGroup* requestGroup,
+ DownloadEngine* e)
+ : Command(cuid),
+ requestGroup_(requestGroup),
+ e_(e),
+ numRetry_(0),
+ lastGetPeerTime_(0)
{
requestGroup_->increaseNumCommand();
}
@@ -79,11 +82,9 @@ bool DHTGetPeersCommand::execute()
(btRuntime_->lessThanMinPeers() &&
lastGetPeerTime_.difference(global::wallclock) >= GET_PEER_MIN_INTERVAL
&& !requestGroup_->downloadFinished()))) {
- if(getLogger()->debug()) {
- getLogger()->debug("Issuing PeerLookup for infoHash=%s",
- bittorrent::getInfoHashString
- (requestGroup_->getDownloadContext()).c_str());
- }
+ A2_LOG_DEBUG(fmt("Issuing PeerLookup for infoHash=%s",
+ bittorrent::getInfoHashString
+ (requestGroup_->getDownloadContext()).c_str()));
task_ = taskFactory_->createPeerLookupTask
(requestGroup_->getDownloadContext(), btRuntime_, peerStorage_);
taskQueue_->addPeriodicTask2(task_);