mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
Logging to file directly. Win32 Services can't write to std::cout
This commit is contained in:
parent
e3ff849aa4
commit
0236879c26
12
Log.cpp
12
Log.cpp
|
@ -1,3 +1,15 @@
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
||||||
|
#include "Daemon.h"
|
||||||
|
|
||||||
i2p::util::MsgQueue<LogMsg> g_Log;
|
i2p::util::MsgQueue<LogMsg> g_Log;
|
||||||
|
|
||||||
|
void LogMsg::Process()
|
||||||
|
{
|
||||||
|
if (Daemon.isLogging == 1 && Daemon.logfile.is_open())
|
||||||
|
{
|
||||||
|
Daemon.logfile << s.str();
|
||||||
|
Daemon.logfile.flush();
|
||||||
|
}
|
||||||
|
output << s.str();
|
||||||
|
}
|
5
Log.h
5
Log.h
|
@ -12,10 +12,7 @@ struct LogMsg
|
||||||
|
|
||||||
LogMsg (std::ostream& o = std::cout): output (o) {};
|
LogMsg (std::ostream& o = std::cout): output (o) {};
|
||||||
|
|
||||||
void Process ()
|
void Process();
|
||||||
{
|
|
||||||
output << s.str ();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern i2p::util::MsgQueue<LogMsg> g_Log;
|
extern i2p::util::MsgQueue<LogMsg> g_Log;
|
||||||
|
|
Loading…
Reference in a new issue