From 272fa955766796bd3c793e5c81f57fc8ecad25a4 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 10 Mar 2017 22:17:37 +0100 Subject: [PATCH] Expand file log header with build info, version and system diagnostics refs #902 --- src/blackmisc/filelogger.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/blackmisc/filelogger.cpp b/src/blackmisc/filelogger.cpp index c35c0280a..ebdf130f4 100644 --- a/src/blackmisc/filelogger.cpp +++ b/src/blackmisc/filelogger.cpp @@ -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)