Skip to content

Commit

Permalink
Logging to file directly. Win32 Services can't write to std::cout
Browse files Browse the repository at this point in the history
  • Loading branch information
chertov committed Apr 22, 2014
1 parent e3ff849 commit 0236879
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
14 changes: 13 additions & 1 deletion Log.cpp
Original file line number Diff line number Diff line change
@@ -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 changes: 1 addition & 4 deletions Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0236879

Please sign in to comment.