mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Old logs are now deleted when creating the logs folder inside the application data directory
This commit is contained in:
parent
a0b4b006a7
commit
8887b9684c
|
@ -385,8 +385,8 @@ bool parseArguments(const std::vector<std::string>& arguments)
|
||||||
Log::setReportingLevel(LogDebug);
|
Log::setReportingLevel(LogDebug);
|
||||||
}
|
}
|
||||||
else if (arguments[i] == "--version" || arguments[i] == "-v") {
|
else if (arguments[i] == "--version" || arguments[i] == "-v") {
|
||||||
std::cout << "ES-DE v" << PROGRAM_VERSION_STRING << " (r"
|
std::cout << "ES-DE v" << PROGRAM_VERSION_STRING << " (r" << PROGRAM_RELEASE_NUMBER
|
||||||
<< PROGRAM_RELEASE_NUMBER << ")\n";
|
<< ")\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (arguments[i] == "--help" || arguments[i] == "-h") {
|
else if (arguments[i] == "--help" || arguments[i] == "-h") {
|
||||||
|
@ -616,6 +616,13 @@ int main(int argc, char* argv[])
|
||||||
std::cerr << "Couldn't create directory, permission problems?" << std::endl;
|
std::cerr << "Couldn't create directory, permission problems?" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Remove any old logs in the root of the directory.
|
||||||
|
Utils::FileSystem::removeFile(
|
||||||
|
Utils::FileSystem::getAppDataDirectory().append("es_log.txt").string());
|
||||||
|
Utils::FileSystem::removeFile(
|
||||||
|
Utils::FileSystem::getAppDataDirectory().append("es_log.txt.bak").string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -623,8 +630,8 @@ int main(int argc, char* argv[])
|
||||||
// Start the logger.
|
// Start the logger.
|
||||||
Log::init();
|
Log::init();
|
||||||
Log::open();
|
Log::open();
|
||||||
LOG(LogInfo) << "ES-DE v" << PROGRAM_VERSION_STRING << " (r"
|
LOG(LogInfo) << "ES-DE v" << PROGRAM_VERSION_STRING << " (r" << PROGRAM_RELEASE_NUMBER
|
||||||
<< PROGRAM_RELEASE_NUMBER << "), built " << PROGRAM_BUILT_STRING;
|
<< "), built " << PROGRAM_BUILT_STRING;
|
||||||
if (portableMode) {
|
if (portableMode) {
|
||||||
LOG(LogInfo) << "Running in portable mode";
|
LOG(LogInfo) << "Running in portable mode";
|
||||||
Settings::getInstance()->setBool("PortableMode", true);
|
Settings::getInstance()->setBool("PortableMode", true);
|
||||||
|
|
Loading…
Reference in a new issue