mirror of
https://github.com/tnodir/fort
synced 2024-11-15 10:45:10 +00:00
UI: Logger: Simplify output.
This commit is contained in:
parent
b2e7b93ddb
commit
ea9904b0f4
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user