Expand file log header with build info, version and system diagnostics

refs #902
This commit is contained in:
Roland Winklmeier
2017-03-10 22:17:37 +01:00
committed by Mathew Sutcliffe
parent 15b50791ef
commit 272fa95576

View File

@@ -7,6 +7,7 @@
* contained in the LICENSE file.
*/
#include "blackconfig/buildconfig.h"
#include "blackmisc/filelogger.h"
#include "blackmisc/loghandler.h"
@@ -115,8 +116,19 @@ namespace BlackMisc
void CFileLogger::writeHeaderToFile()
{
QString header(QStringLiteral("Application started."));
writeContentToFile(header);
m_stream << "This is " << m_applicationName;
m_stream << " version " << BlackConfig::CVersion::version();
m_stream << " running on " << QSysInfo::prettyProductName();
m_stream << " " << QSysInfo::currentCpuArchitecture() << endl;
m_stream << "Built from revision " << BlackConfig::CBuildConfig::gitHeadSha1();
m_stream << " on " << BlackConfig::CBuildConfig::buildDateAndTime() << endl;
m_stream << "Built with Qt " << QT_VERSION_STR;
m_stream << " and running with Qt " << qVersion();
m_stream << " " << QSysInfo::buildAbi() << endl;
m_stream << "Application started." << endl;
}
void CFileLogger::writeContentToFile(const QString &content)