Logging: also print pointer size of building architecture

This commit is contained in:
f4exb 2018-01-07 03:20:27 +01:00
parent 333df92c06
commit 1f4cdd1f3c
4 changed files with 29 additions and 17 deletions

View File

@ -95,14 +95,19 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
parser.parse(*qApp);
#if QT_VERSION >= 0x050400
qInfo("%s v%s Qt %s %s %s",
qInfo("%s %s Qt %s %db %s %s",
qPrintable(qApp->applicationName()),
qPrintable(qApp->applicationVersion()),
qPrintable(QString(QT_VERSION_STR)),
QT_POINTER_SIZE*8,
qPrintable(QSysInfo::currentCpuArchitecture()),
qPrintable(QSysInfo::prettyProductName()));
#else
qInfo("%s v%s Qt %s", qPrintable(qApp->applicationName()), qPrintable((qApp->applicationVersion()), qPrintable(QString(QT_VERSION_STR)));
qInfo("%s %s Qt %s %db",
qPrintable(qApp->applicationName()),
qPrintable((qApp->applicationVersion()),
qPrintable(QString(QT_VERSION_STR)),
QT_POINTER_SIZE*8);
#endif
MainWindow w(logger, parser);

View File

@ -65,14 +65,19 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
parser.parse(a);
#if QT_VERSION >= 0x050400
qInfo("%s v%s Qt %s %s %s",
qInfo("%s %s Qt %s %db %s %s",
qPrintable(qApp->applicationName()),
qPrintable(qApp->applicationVersion()),
qPrintable(QString(QT_VERSION_STR)),
QT_POINTER_SIZE*8,
qPrintable(QSysInfo::currentCpuArchitecture()),
qPrintable(QSysInfo::prettyProductName()));
#else
qInfo("%s v%s Qt %s", qPrintable(qApp->applicationName()), qPrintable((qApp->applicationVersion()), qPrintable(QString(QT_VERSION_STR)));
qInfo("%s %s Qt %s %db",
qPrintable(qApp->applicationName()),
qPrintable((qApp->applicationVersion()),
qPrintable(QString(QT_VERSION_STR)),
QT_POINTER_SIZE*8);
#endif
MainCore m(logger, parser, &a);

View File

@ -1729,19 +1729,20 @@ void MainWindow::setLoggingOptions()
if (m_settings.getUseLogFile())
{
#if QT_VERSION >= 0x050400
QString appInfoStr(tr("%1 v%2 Qt %3 %4 %5")
QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6")
.arg(qApp->applicationName())
.arg(qApp->applicationVersion())
.arg(QT_VERSION_STR)
.arg(QT_POINTER_SIZE*8)
.arg(QSysInfo::currentCpuArchitecture())
.arg(QSysInfo::prettyProductName()));
#else
QString appInfoStr(tr("%1 v%2 Qt %3")
QString appInfoStr(tr("%1 v%2 Qt %3 %4b")
.arg(qApp->applicationName())
.arg(qApp->applicationVersion())
.arg(QT_VERSION_STR));
.arg(QT_VERSION_STR)
.arg(QT_POINTER_SIZE*8));
#endif
m_logger->logToFile(QtInfoMsg, appInfoStr);
}
}

View File

@ -221,19 +221,20 @@ void MainCore::setLoggingOptions()
if (m_settings.getUseLogFile())
{
#if QT_VERSION >= 0x050400
QString appInfoStr(tr("%1 v%2 Qt %3 %4 %5")
.arg(QCoreApplication::instance()->applicationName())
.arg(QCoreApplication::instance()->applicationVersion())
QString appInfoStr(tr("%1 %2 Qt %3 %4b %5 %6")
.arg(qApp->applicationName())
.arg(qApp->applicationVersion())
.arg(QT_VERSION_STR)
.arg(QT_POINTER_SIZE*8)
.arg(QSysInfo::currentCpuArchitecture())
.arg(QSysInfo::prettyProductName()));
#else
QString appInfoStr(tr("%1 v%2 Qt %3")
.arg(QCoreApplication::instance()->applicationName())
.arg(QCoreApplication::instance()->applicationVersion())
.arg(QT_VERSION_STR));
#endif
QString appInfoStr(tr("%1 v%2 Qt %3 %4b")
.arg(qApp->applicationName())
.arg(qApp->applicationVersion())
.arg(QT_VERSION_STR)
.arg(QT_POINTER_SIZE*8));
#endif
m_logger->logToFile(QtInfoMsg, appInfoStr);
}
}