Complete the log rotate even if we can't rename the existing log file.

This commit is contained in:
JoelKatz
2013-04-19 00:39:10 -07:00
parent 36a3b84dba
commit 43d6a0ad86

View File

@@ -109,7 +109,15 @@ std::string Log::rotateLog(void)
} while (boost::filesystem::exists(boost::filesystem::path(abs_new_path_str)));
outStream->close();
boost::filesystem::rename(abs_path, boost::filesystem::path(abs_new_path_str));
try
{
boost::filesystem::rename(abs_path, boost::filesystem::path(abs_new_path_str));
}
catch (...)
{
// unable to rename existing log file
}
setLogFile(*pathToLog);