summaryrefslogtreecommitdiff
path: root/src/logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/logger.cpp')
-rw-r--r--src/logger.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index 05fb801ae..049b4b5e7 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -341,13 +341,15 @@ void FileWriter::HandleEvent(EventType ev, int)
void FileWriter::WriteLogLine(const std::string &line)
{
- if (log)
+ if (log == NULL)
+ return;
+// XXX: For now, just return. Don't throw an exception. It'd be nice to find out if this is happening, but I'm terrified of breaking so close to final release. -- w00t
+// throw CoreException("FileWriter::WriteLogLine called with a closed logfile");
+
+ fprintf(log,"%s",line.c_str());
+ if (writeops++ % 20)
{
- fprintf(log,"%s",line.c_str());
- if (writeops++ % 20)
- {
- fflush(log);
- }
+ fflush(log);
}
}
@@ -357,6 +359,7 @@ void FileWriter::Close()
{
fflush(log);
fclose(log);
+ log = NULL;
}
}