UI: Logger: Simplify output.

This commit is contained in:
Nodir Temirkhodjaev 2019-04-08 16:22:44 +05:00
parent b2e7b93ddb
commit ea9904b0f4

View File

@ -93,11 +93,10 @@ void Logger::closeLogFile()
void Logger::writeLogLine(Logger::LogLevel level, const QString &dateString, void Logger::writeLogLine(Logger::LogLevel level, const QString &dateString,
const QString &message) const QString &message)
{ {
static const char * const g_levelTexts[] = { static const char * const g_levelChars = "IWE";
"[Info]", "[Warn]", "[Fail]"};
const QString line = dateString const QString line = dateString
+ ' ' + g_levelTexts[int(level)] + ' ' + g_levelChars[int(level)]
+ ' ' + message + '\n'; + ' ' + message + '\n';
m_file.write(line.toLatin1()); m_file.write(line.toLatin1());
@ -124,8 +123,7 @@ void Logger::writeLog(const QString &message, Logger::LogLevel level)
} }
// Write file header // Write file header
writeLogLine(Info, dateString, APP_NAME " version: " APP_VERSION_STR writeLogLine(Info, dateString, APP_NAME " version: " APP_VERSION_STR);
" build date: " __DATE__ " " __TIME__);
} }
writeLogLine(level, dateString, message); writeLogLine(level, dateString, message);