flush log only when queue is empty

This commit is contained in:
orignal committed 2014-04-23 12:49:02 -04:00
1 parent 42f228e75a
commit 58939de57e
3 files changed
+31 -6

No files matched your search

+10 -5
View File
@@ -2,14 +2,19 @@
#include "Daemon.h"
i2p::util::MsgQueue<LogMsg> g_Log;
Log g_Log;
void LogMsg::Process()
{
if (Daemon.isLogging == 1 && Daemon.logfile.is_open())
{
Daemon.logfile << s.str();
Daemon.logfile.flush();
}
output << s.str();
}
}
void Log::Flush ()
{
if (Daemon.isLogging == 1 && Daemon.logfile.is_open())
Daemon.logfile.flush();
}