- misc logs and screenshots now also go in userdata folder

This commit is contained in:
Mark Vejvoda
2011-03-10 17:31:55 +00:00
parent 0e1b8e62e4
commit 819831a287
6 changed files with 60 additions and 8 deletions

View File

@@ -491,6 +491,16 @@ void Program::init(WindowGl *window, bool initSound, bool toggleFullScreen){
string logFile = "glest.log";
if(getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) != "") {
logFile = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) + logFile;
}
else {
string userData = config.getString("UserData_Root","");
if(userData != "") {
if(userData != "" && EndsWith(userData, "/") == false && EndsWith(userData, "\\") == false) {
userData += "/";
}
}
logFile = userData + logFile;
}
logger.setFile(logFile);
logger.clear();