UI: Logger: Improve log file title

This commit is contained in:
Nodir Temirkhodjaev 2023-12-20 14:44:33 +03:00
parent 6c4ce1f372
commit ca4aab5733
2 changed files with 9 additions and 1 deletions

View File

@ -106,6 +106,12 @@ void Logger::setPath(const QString &path)
m_dir.setPath(path);
}
QString Logger::getFileTitle() const
{
return QLatin1String(APP_NAME) + " v" + APP_VERSION_STR
+ (isService() ? " Service" : QString());
}
Logger *Logger::instance()
{
static Logger *g_instanceLogger = nullptr;
@ -196,7 +202,7 @@ void Logger::writeLog(const QString &dateString, const QString &logLine)
}
// Write file header
writeLogLine(makeLogLine(Info, dateString, APP_NAME " v" APP_VERSION_STR));
writeLogLine(makeLogLine(Info, dateString, getFileTitle()));
}
writeLogLine(logLine);

View File

@ -26,6 +26,8 @@ public:
void setPath(const QString &path);
QString getFileTitle() const;
static Logger *instance();
static QString getDateString();