summaryrefslogtreecommitdiff
path: root/src/PollEventPoll.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/PollEventPoll.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/PollEventPoll.cc')
-rw-r--r--src/PollEventPoll.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/PollEventPoll.cc b/src/PollEventPoll.cc
index 1af0771d..e5933e24 100644
--- a/src/PollEventPoll.cc
+++ b/src/PollEventPoll.cc
@@ -42,11 +42,13 @@
#include "LogFactory.h"
#include "Logger.h"
#include "a2functional.h"
+#include "fmt.h"
namespace aria2 {
-PollEventPoll::KSocketEntry::KSocketEntry(sock_t s):
- SocketEntry<KCommandEvent, KADNSEvent>(s) {}
+PollEventPoll::KSocketEntry::KSocketEntry(sock_t s)
+ : SocketEntry<KCommandEvent, KADNSEvent>(s)
+{}
int accumulateEvent(int events, const PollEventPoll::KEvent& event)
{
@@ -73,8 +75,9 @@ struct pollfd PollEventPoll::KSocketEntry::getEvents()
return pollEvent;
}
-PollEventPoll::PollEventPoll():
- pollfdCapacity_(1024), pollfdNum_(0), logger_(LogFactory::getInstance())
+PollEventPoll::PollEventPoll()
+ : pollfdCapacity_(1024),
+ pollfdNum_(0)
{
pollfds_ = new struct pollfd[pollfdCapacity_];
}
@@ -103,10 +106,8 @@ void PollEventPoll::poll(const struct timeval& tv)
if(itr != socketEntries_.end() && *(*itr) == *se) {
(*itr)->processEvents(first->revents);
} else {
- if(logger_->debug()) {
- logger_->debug("Socket %d is not found in SocketEntries.",
- first->fd);
- }
+ A2_LOG_DEBUG(fmt("Socket %d is not found in SocketEntries.",
+ first->fd));
}
}
}
@@ -221,9 +222,7 @@ bool PollEventPoll::deleteEvents
}
return true;
} else {
- if(logger_->debug()) {
- logger_->debug("Socket %d is not found in SocketEntries.", socket);
- }
+ A2_LOG_DEBUG(fmt("Socket %d is not found in SocketEntries.", socket));
return false;
}
}