diff options
author | Adam <Adam@anope.org> | 2010-09-21 01:20:28 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-09-21 01:20:28 -0400 |
commit | 34592069801b11d852b7f4d7cb1594e72058f8c3 (patch) | |
tree | 1469e58b72ce5d86dd910d3ee33d8ae9cd3cfe3a /src | |
parent | 6f707920ffb30c51efce37cc8ebd82a7679388bf (diff) |
Fixed some problems with cycling logfiles
Diffstat (limited to 'src')
-rw-r--r-- | src/logger.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 15f69cfb6..61e8915b8 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -350,7 +350,9 @@ void LogInfo::ProcessMessage(const Log *l) if (log && log->GetName() != CreateLogName(target)) { delete log; + this->Logfiles.erase(lit); log = new LogFile(CreateLogName(target)); + this->Logfiles[target] = log; if (this->LogAge) { @@ -364,15 +366,14 @@ void LogInfo::ProcessMessage(const Log *l) } if (!log || !log->stream.is_open()) { - if (log && lastwarn + 300 > Anope::CurTime) + if (log && lastwarn + 300 < Anope::CurTime) { lastwarn = Anope::CurTime; Log() << "Unable to open logfile " << log->GetName(); } delete log; - log = NULL; this->Logfiles.erase(lit); - continue; + log = NULL; } } else if (lit == this->Logfiles.end()) @@ -381,17 +382,16 @@ void LogInfo::ProcessMessage(const Log *l) if (!log->stream.is_open()) { - if (lastwarn + 300 > Anope::CurTime) + if (lastwarn + 300 < Anope::CurTime) { lastwarn = Anope::CurTime; Log() << "Unable to open logfile " << log->GetName(); - delete log; - log = NULL; - continue; } + delete log; + log = NULL; } - - this->Logfiles[target] = log; + else + this->Logfiles[target] = log; } if (log) |