mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
add dedicated method to get logs path
This commit is contained in:
parent
03b4ea71ba
commit
99af5bbe4c
@ -232,7 +232,7 @@ int main(int argc, char * argv[])
|
||||
*console->cb = processCommand;
|
||||
console->start();
|
||||
|
||||
const bfs::path logPath = VCMIDirs::get().userCachePath() / "VCMI_Client_log.txt";
|
||||
const bfs::path logPath = VCMIDirs::get().userLogsPath() / "VCMI_Client_log.txt";
|
||||
logConfig = new CBasicLogConfigurator(logPath, console);
|
||||
logConfig->configureDefault();
|
||||
logGlobal->info(NAME);
|
||||
|
@ -685,7 +685,7 @@ void CServerHandler::threadRunServer()
|
||||
{
|
||||
#ifndef VCMI_ANDROID
|
||||
setThreadName("CServerHandler::threadRunServer");
|
||||
const std::string logName = (VCMIDirs::get().userCachePath() / "server_log.txt").string();
|
||||
const std::string logName = (VCMIDirs::get().userLogsPath() / "server_log.txt").string();
|
||||
std::string comm = VCMIDirs::get().serverPath().string()
|
||||
+ " --port=" + getDefaultPortStr()
|
||||
+ " --run-by-client"
|
||||
|
@ -28,7 +28,7 @@ void MainWindow::load()
|
||||
QDir::setCurrent(QApplication::applicationDirPath());
|
||||
|
||||
console = new CConsoleHandler();
|
||||
CBasicLogConfigurator logConfig(VCMIDirs::get().userCachePath() / "VCMI_Launcher_log.txt", console);
|
||||
CBasicLogConfigurator logConfig(VCMIDirs::get().userLogsPath() / "VCMI_Launcher_log.txt", console);
|
||||
logConfig.configureDefault();
|
||||
|
||||
CResourceHandler::initialize();
|
||||
|
@ -13,6 +13,8 @@
|
||||
|
||||
namespace bfs = boost::filesystem;
|
||||
|
||||
bfs::path IVCMIDirs::userLogsPath() const { return userCachePath(); }
|
||||
|
||||
bfs::path IVCMIDirs::userSavePath() const { return userDataPath() / "Saves"; }
|
||||
|
||||
bfs::path IVCMIDirs::fullLibraryPath(const std::string &desiredFolder, const std::string &baseLibName) const
|
||||
@ -35,6 +37,7 @@ std::string IVCMIDirs::genHelpString() const
|
||||
" user data: " + userDataPath().string() + "\n"
|
||||
" user cache: " + userCachePath().string() + "\n"
|
||||
" user config: " + userConfigPath().string() + "\n"
|
||||
" user logs: " + userLogsPath().string() + "\n"
|
||||
" user saves: " + userSavePath().string() + "\n"; // Should end without new-line?
|
||||
}
|
||||
|
||||
@ -44,6 +47,7 @@ void IVCMIDirs::init()
|
||||
bfs::create_directories(userDataPath());
|
||||
bfs::create_directories(userCachePath());
|
||||
bfs::create_directories(userConfigPath());
|
||||
bfs::create_directories(userLogsPath());
|
||||
bfs::create_directories(userSavePath());
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,9 @@ public:
|
||||
// Path to writeable directory with user configs
|
||||
virtual boost::filesystem::path userConfigPath() const = 0;
|
||||
|
||||
// Path to writeable directory to store log files
|
||||
virtual boost::filesystem::path userLogsPath() const;
|
||||
|
||||
// Path to saved games
|
||||
virtual boost::filesystem::path userSavePath() const;
|
||||
|
||||
|
@ -915,7 +915,7 @@ int main(int argc, char * argv[])
|
||||
#endif
|
||||
|
||||
console = new CConsoleHandler();
|
||||
CBasicLogConfigurator logConfig(VCMIDirs::get().userCachePath() / "VCMI_Server_log.txt", console);
|
||||
CBasicLogConfigurator logConfig(VCMIDirs::get().userLogsPath() / "VCMI_Server_log.txt", console);
|
||||
logConfig.configureDefault();
|
||||
logGlobal->info(NAME);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user