flush log only when queue is empty

This commit is contained in:
orignal 2014-04-23 12:49:02 -04:00
parent 42f228e75a
commit 58939de57e
3 changed files with 31 additions and 6 deletions

15
Log.cpp
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();
}