瀏覽代碼

Merge pull request #5244 from Sko0owi/logLocationBeta

Adding flag for changing location of logs for VCMI client
Ivan Savenko 8 月之前
父節點
當前提交
37b981e4a0
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      clientapp/EntryPoint.cpp

+ 4 - 1
clientapp/EntryPoint.cpp

@@ -158,6 +158,7 @@ int main(int argc, char * argv[])
 		("version,v", "display version information and exit")
 		("testmap", po::value<std::string>(), "")
 		("testsave", po::value<std::string>(), "")
+		("logLocation", po::value<std::string>(), "new location for log files")
 		("spectate,s", "enable spectator interface for AI-only games")
 		("spectate-ignore-hero", "wont follow heroes on adventure map")
 		("spectate-hero-speed", po::value<int>(), "hero movement speed on adventure map")
@@ -225,7 +226,9 @@ int main(int argc, char * argv[])
 #endif
 
 	setThreadNameLoggingOnly("MainGUI");
-	const boost::filesystem::path logPath = VCMIDirs::get().userLogsPath() / "VCMI_Client_log.txt";
+	boost::filesystem::path logPath = VCMIDirs::get().userLogsPath() / "VCMI_Client_log.txt";
+	if(vm.count("logLocation"))
+		logPath = vm["logLocation"].as<std::string>() + "/VCMI_Client_log.txt";
 	logConfig = new CBasicLogConfigurator(logPath, console);
 	logConfig->configureDefault();
 	logGlobal->info("Starting client of '%s'", GameConstants::VCMI_VERSION);