From 65c13f1758ea591ce9dcaf4e467c82f85f375c3a Mon Sep 17 00:00:00 2001 From: Cameron Norman Date: Sat, 25 Oct 2014 18:25:03 -0700 Subject: [PATCH] Decouple logging and daemonization --- Daemon.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Daemon.cpp b/Daemon.cpp index ea98378b..284466f2 100644 --- a/Daemon.cpp +++ b/Daemon.cpp @@ -84,18 +84,13 @@ namespace i2p // initialize log if (isLogging) { - if (isDaemon) - { - std::string logfile_path = IsService () ? "/var/log" : i2p::util::filesystem::GetDataDir().string(); + std::string logfile_path = IsService () ? "/var/log" : i2p::util::filesystem::GetDataDir().string(); #ifndef _WIN32 - logfile_path.append("/i2pd.log"); + logfile_path.append("/i2pd.log"); #else - logfile_path.append("\\i2pd.log"); + logfile_path.append("\\i2pd.log"); #endif - StartLog (logfile_path); - } - else - StartLog (""); // write to stdout + StartLog (logfile_path); } d.httpServer = new i2p::util::HTTPServer(i2p::util::config::GetArg("-httpport", 7070));