Browse Source

log to file if daemon only

pull/73/merge
orignal 11 years ago
parent
commit
8aaaf26a9e
  1. 5
      Daemon.cpp
  2. 1
      Log.h

5
Daemon.cpp

@ -66,6 +66,8 @@ namespace i2p @@ -66,6 +66,8 @@ namespace i2p
{
// initialize log
if (isLogging)
{
if (isDaemon)
{
std::string logfile_path = i2p::util::filesystem::GetDataDir().string();
#ifndef _WIN32
@ -75,6 +77,9 @@ namespace i2p @@ -75,6 +77,9 @@ namespace i2p
#endif
StartLog (logfile_path);
}
else
StartLog (""); // write to stdout
}
d.httpServer = new i2p::util::HTTPServer(i2p::util::config::GetArg("-httpport", 7070));
d.httpServer->Start();

1
Log.h

@ -44,6 +44,7 @@ inline void StartLog (const std::string& fullFilePath) @@ -44,6 +44,7 @@ inline void StartLog (const std::string& fullFilePath)
if (!g_Log)
{
g_Log = new Log ();
if (fullFilePath.length () > 0)
g_Log->SetLogFile (fullFilePath);
}
}

Loading…
Cancel
Save