logic: fix log file did not have a name
This commit is contained in:
@@ -30,7 +30,13 @@ void FileLogger::setLogDirectory(const std::string& filePath)
|
||||
|
||||
void FileLogger::setFileName(const std::string& fileName)
|
||||
{
|
||||
m_logFileName = fileName;
|
||||
if (fileName != m_logFileName)
|
||||
{
|
||||
m_logFileName = fileName;
|
||||
m_currentLogLineCount = 0;
|
||||
m_currentLogFileCount = 0;
|
||||
updateLogFileName();
|
||||
}
|
||||
}
|
||||
|
||||
void FileLogger::logInfo(const LogMessage& message)
|
||||
|
||||
@@ -21,12 +21,12 @@ std::string LoggerUtility::generateDatedFileName(const std::string& prefix, cons
|
||||
filename << (t.tm_hour < 10 ? "0" : "") << t.tm_hour << "-";
|
||||
filename << (t.tm_min < 10 ? "0" : "") << t.tm_min << "-";
|
||||
filename << (t.tm_sec < 10 ? "0" : "") << t.tm_sec;
|
||||
if (prefix.length() > 0)
|
||||
|
||||
if (suffix.length() > 0)
|
||||
{
|
||||
filename << "_";
|
||||
filename << suffix;
|
||||
}
|
||||
|
||||
|
||||
return filename.str();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user