mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
flush log only when queue is empty
This commit is contained in:
parent
42f228e75a
commit
58939de57e
3 changed files with 31 additions and 6 deletions
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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue