summaryrefslogtreecommitdiff
path: root/src/TimedHaltCommand.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/TimedHaltCommand.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/TimedHaltCommand.cc')
-rw-r--r--src/TimedHaltCommand.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/TimedHaltCommand.cc b/src/TimedHaltCommand.cc
index ab36a110..1962b812 100644
--- a/src/TimedHaltCommand.cc
+++ b/src/TimedHaltCommand.cc
@@ -36,15 +36,19 @@
#include "DownloadEngine.h"
#include "RequestGroupMan.h"
#include "Logger.h"
+#include "LogFactory.h"
#include "message.h"
+#include "fmt.h"
namespace aria2 {
-TimedHaltCommand::TimedHaltCommand(cuid_t cuid, DownloadEngine* e,
- time_t secondsToHalt,
- bool forceHalt):
- TimeBasedCommand(cuid, e, secondsToHalt, true),
- forceHalt_(forceHalt) {}
+TimedHaltCommand::TimedHaltCommand
+(cuid_t cuid, DownloadEngine* e,
+ time_t secondsToHalt,
+ bool forceHalt)
+ : TimeBasedCommand(cuid, e, secondsToHalt, true),
+ forceHalt_(forceHalt)
+{}
TimedHaltCommand::~TimedHaltCommand() {}
@@ -59,10 +63,10 @@ void TimedHaltCommand::preProcess()
void TimedHaltCommand::process()
{
if(!getDownloadEngine()->isHaltRequested()) {
- getLogger()->notice(MSG_TIME_HAS_PASSED,
- static_cast<long int>(getInterval()));
+ A2_LOG_NOTICE(fmt(MSG_TIME_HAS_PASSED,
+ static_cast<long int>(getInterval())));
if(forceHalt_) {
- getLogger()->notice("This is emergency shutdown.");
+ A2_LOG_NOTICE("This is emergency shutdown.");
getDownloadEngine()->requestForceHalt();
} else {
getDownloadEngine()->requestHalt();