summaryrefslogtreecommitdiff
path: root/src/ActivePeerConnectionCommand.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/ActivePeerConnectionCommand.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/ActivePeerConnectionCommand.cc')
-rw-r--r--src/ActivePeerConnectionCommand.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/ActivePeerConnectionCommand.cc b/src/ActivePeerConnectionCommand.cc
index e718c8bd..6b11e98b 100644
--- a/src/ActivePeerConnectionCommand.cc
+++ b/src/ActivePeerConnectionCommand.cc
@@ -41,6 +41,7 @@
#include "BtRuntime.h"
#include "Peer.h"
#include "Logger.h"
+#include "LogFactory.h"
#include "prefs.h"
#include "Option.h"
#include "BtConstants.h"
@@ -51,6 +52,7 @@
#include "bittorrent_helper.h"
#include "wallclock.h"
#include "util.h"
+#include "fmt.h"
namespace aria2 {
@@ -59,12 +61,11 @@ ActivePeerConnectionCommand::ActivePeerConnectionCommand
RequestGroup* requestGroup,
DownloadEngine* e,
time_t interval)
- :
- Command(cuid),
- requestGroup_(requestGroup),
- interval_(interval),
- e_(e),
- numNewConnection_(5)
+ : Command(cuid),
+ requestGroup_(requestGroup),
+ interval_(interval),
+ e_(e),
+ numNewConnection_(5)
{
requestGroup_->increaseNumCommand();
}
@@ -141,11 +142,9 @@ void ActivePeerConnectionCommand::connectToPeer(const SharedHandle<Peer>& peer)
command->setPeerStorage(peerStorage_);
command->setPieceStorage(pieceStorage_);
e_->addCommand(command);
- if(getLogger()->info()) {
- getLogger()->info(MSG_CONNECTING_TO_PEER,
- util::itos(getCuid()).c_str(),
- peer->getIPAddress().c_str());
- }
+ A2_LOG_INFO(fmt(MSG_CONNECTING_TO_PEER,
+ util::itos(getCuid()).c_str(),
+ peer->getIPAddress().c_str()));
}
void ActivePeerConnectionCommand::setBtRuntime