Browse Source

Logging to file directly. Win32 Services can't write to std::cout

pull/69/head
chertov 11 years ago
parent
commit
0236879c26
  1. 14
      Log.cpp
  2. 5
      Log.h

14
Log.cpp

@ -1,3 +1,15 @@ @@ -1,3 +1,15 @@
#include "Log.h"
i2p::util::MsgQueue<LogMsg> g_Log;
#include "Daemon.h"
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

@ -12,10 +12,7 @@ struct LogMsg @@ -12,10 +12,7 @@ struct LogMsg
LogMsg (std::ostream& o = std::cout): output (o) {};
void Process ()
{
output << s.str ();
}
void Process();
};
extern i2p::util::MsgQueue<LogMsg> g_Log;

Loading…
Cancel
Save