mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
flush log only when queue is empty
This commit is contained in:
15
Log.cpp
15
Log.cpp
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user