diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-06-08 15:02:20 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-06-08 15:02:20 +0000 |
| commit | 9afc36152a1ce428243a3ace608d0508716a2efb (patch) | |
| tree | 2e144d04570a058f3e2716d7b98f16803392cdbe /src/TrackerWatcherCommand.cc | |
| parent | 7cd9b21937c42606354610c7ae85a0857b474cf5 (diff) | |
2010-06-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made protected member variables of Command private. Added accessor
funcs.
Diffstat (limited to 'src/TrackerWatcherCommand.cc')
| -rw-r--r-- | src/TrackerWatcherCommand.cc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/TrackerWatcherCommand.cc b/src/TrackerWatcherCommand.cc index 9426e4a4..38829411 100644 --- a/src/TrackerWatcherCommand.cc +++ b/src/TrackerWatcherCommand.cc @@ -96,8 +96,8 @@ bool TrackerWatcherCommand::execute() { } } if(_btAnnounce->noMoreAnnounce()) { - if(logger->debug()) { - logger->debug("no more announce"); + if(getLogger()->debug()) { + getLogger()->debug("no more announce"); } return true; } @@ -108,13 +108,13 @@ bool TrackerWatcherCommand::execute() { try { _trackerRequestGroup->createInitialCommand(commands, e); } catch(RecoverableException& ex) { - logger->error(EX_EXCEPTION_CAUGHT, ex); + getLogger()->error(EX_EXCEPTION_CAUGHT, ex); std::for_each(commands.begin(), commands.end(), Deleter()); commands.clear(); } e->addCommand(commands); - if(logger->debug()) { - logger->debug("added tracker request command"); + if(getLogger()->debug()) { + getLogger()->debug("added tracker request command"); } } } else if(_trackerRequestGroup->downloadFinished()){ @@ -125,7 +125,7 @@ bool TrackerWatcherCommand::execute() { _btAnnounce->announceSuccess(); _btAnnounce->resetAnnounce(); } catch(RecoverableException& ex) { - logger->error(EX_EXCEPTION_CAUGHT, ex); + getLogger()->error(EX_EXCEPTION_CAUGHT, ex); _btAnnounce->announceFailure(); if(_btAnnounce->isAllAnnounceFailed()) { _btAnnounce->resetAnnounce(); @@ -180,10 +180,10 @@ void TrackerWatcherCommand::processTrackerResponse command->setPeerStorage(_peerStorage); command->setPieceStorage(_pieceStorage); e->addCommand(command); - if(logger->debug()) { - logger->debug("CUID#%s - Adding new command CUID#%s", - util::itos(cuid).c_str(), - util::itos(peer->usedBy()).c_str()); + if(getLogger()->debug()) { + getLogger()->debug("CUID#%s - Adding new command CUID#%s", + util::itos(getCuid()).c_str(), + util::itos(peer->usedBy()).c_str()); } } } @@ -222,12 +222,12 @@ TrackerWatcherCommand::createRequestGroup(const std::string& uri) uris.push_back(uri); SharedHandle<RequestGroup> rg(new RequestGroup(getOption())); if(backupTrackerIsAvailable(_requestGroup->getDownloadContext())) { - if(logger->debug()) { - logger->debug("This is multi-tracker announce."); + if(getLogger()->debug()) { + getLogger()->debug("This is multi-tracker announce."); } } else { - if(logger->debug()) { - logger->debug("This is single-tracker announce."); + if(getLogger()->debug()) { + getLogger()->debug("This is single-tracker announce."); } } // If backup tracker is available, try 2 times for each tracker @@ -253,9 +253,9 @@ TrackerWatcherCommand::createRequestGroup(const std::string& uri) rg->setFileAllocationEnabled(false); rg->setPreLocalFileCheckEnabled(false); util::removeMetalinkContentTypes(rg); - if(logger->info()) { - logger->info("Creating tracker request group GID#%s", - util::itos(rg->getGID()).c_str()); + if(getLogger()->info()) { + getLogger()->info("Creating tracker request group GID#%s", + util::itos(rg->getGID()).c_str()); } return rg; } |
