diff --git a/Log.cpp b/Log.cpp index b5e49612..4db4920e 100644 --- a/Log.cpp +++ b/Log.cpp @@ -1,3 +1,15 @@ #include "Log.h" -i2p::util::MsgQueue g_Log; \ No newline at end of file +#include "Daemon.h" + +i2p::util::MsgQueue g_Log; + +void LogMsg::Process() +{ + if (Daemon.isLogging == 1 && Daemon.logfile.is_open()) + { + Daemon.logfile << s.str(); + Daemon.logfile.flush(); + } + output << s.str(); +} \ No newline at end of file diff --git a/Log.h b/Log.h index e538b7be..acef8f8e 100644 --- a/Log.h +++ b/Log.h @@ -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 g_Log;