From deb87f1d4cbb974969f2bea91ccfb24b57972132 Mon Sep 17 00:00:00 2001 From: hagen Date: Mon, 1 Feb 2016 00:00:00 +0000 Subject: [PATCH] * for compatibility - leave --log option with arg --- Config.cpp | 4 ++-- Daemon.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Config.cpp b/Config.cpp index 536277b4..60af0319 100644 --- a/Config.cpp +++ b/Config.cpp @@ -46,7 +46,7 @@ namespace config { }; /* list of options, that loose their argument and become simple switch */ std::set boolean_options = { - "daemon", "log", "floodfill", "notransit", "service", "ipv6" + "daemon", "floodfill", "notransit", "service", "ipv6" }; /* this function is a solid piece of shit, remove it after 2.6.0 */ @@ -110,7 +110,7 @@ namespace config { ("conf", value()->default_value(""), "Path to main i2pd config file (default: try ~/.i2pd/i2p.conf or /var/lib/i2pd/i2p.conf)") ("tunconf", value()->default_value(""), "Path to config with tunnels list and options (default: try ~/.i2pd/tunnels.cfg or /var/lib/i2pd/tunnels.cfg)") ("pidfile", value()->default_value(""), "Write pidfile to given path") - ("log", value()->zero_tokens(), "Write logs to file instead stdout") + ("log", value()->default_value(""), "Write logs to file instead stdout") ("logfile", value()->default_value(""), "Path to logfile (stdout if not set, autodetect if daemon)") ("loglevel", value()->default_value("info"), "Set the minimal level of log messages (debug, info, warn, error)") ("host", value()->default_value(""), "External IP (deprecated)") diff --git a/Daemon.cpp b/Daemon.cpp index a0c3f5bb..ce8ad35c 100644 --- a/Daemon.cpp +++ b/Daemon.cpp @@ -78,7 +78,11 @@ namespace i2p i2p::context.Init (); i2p::config::GetOption("daemon", isDaemon); - i2p::config::GetOption("log", isLogging); + // temporary hack + std::string logs = ""; + i2p::config::GetOption("log", logs); + if (logs != "") + isLogging = true; uint16_t port; i2p::config::GetOption("port", port); LogPrint(eLogInfo, "Daemon: accepting incoming connections at port ", port);