log cleanup (#3207)

This commit is contained in:
tooomm 2018-05-02 22:07:43 +02:00 committed by Zach H
parent 2780270911
commit 661e00f563
3 changed files with 20 additions and 18 deletions

View file

@ -1,14 +1,14 @@
<b>System Information:</b> <b>System Information:</b>
<!-- Go to "Help → View Debug Log" and copy the top few lines here! --> <!-- Go to "Help → View Debug Log" and copy all lines above the separation here! -->
<!-- If you can't install Cockatrice to access that information, make <!-- If you can't install Cockatrice to access that information, make
sure to include your OS and the app version from the setup file here --> sure to include your OS and the app version from the setup file here -->
________________________________________________________________________________________ __________________________________________________________________________________________
<!-- Explain your issue/request/suggestion in detail here! --> <!-- Explain your issue/request/suggestion in detail here! -->
<!-- This repository is ONLY about development of the Cockatrice app. <!-- This repository is ONLY about development of the Cockatrice app.
If you have any problems with a server (e.g. registering, connecting, ban...) If you have any problems with a server (e.g. registering, connecting, ban...)
you have to contact that server's owner/admin. you have to contact that server's owner/admin.
Check this list of public servers with webpage links and contact details: Check this list of public servers with webpage links and contact details:
https://github.com/Cockatrice/Cockatrice/wiki/Public-Servers --> https://github.com/Cockatrice/Cockatrice/wiki/Public-Servers -->

View file

@ -16,7 +16,7 @@ DlgViewLog::DlgViewLog(QWidget *parent) : QDialog(parent)
coClearLog = new QCheckBox; coClearLog = new QCheckBox;
coClearLog->setText(tr("Clear log when closing")); coClearLog->setText(tr("Clear log when closing"));
coClearLog->setChecked(settingsCache->servers().getClearDebugLogStatus(true)); coClearLog->setChecked(settingsCache->servers().getClearDebugLogStatus(false));
connect(coClearLog, SIGNAL(toggled(bool)), this, SLOT(actCheckBoxChanged(bool))); connect(coClearLog, SIGNAL(toggled(bool)), this, SLOT(actCheckBoxChanged(bool)));
mainLayout->addWidget(coClearLog); mainLayout->addWidget(coClearLog);
@ -50,8 +50,8 @@ void DlgViewLog::closeEvent(QCloseEvent * /* event */)
{ {
if (coClearLog->isChecked()) { if (coClearLog->isChecked()) {
logArea->clear(); logArea->clear();
}
logArea->appendPlainText(Logger::getInstance().getClientVersion()); logArea->appendPlainText(Logger::getInstance().getClientVersion());
logArea->appendPlainText(Logger::getInstance().getSystemArchitecture()); logArea->appendPlainText(Logger::getInstance().getSystemArchitecture());
}
} }

View file

@ -16,6 +16,7 @@ Logger::Logger() : logToFileEnabled(false)
logBuffer.append(getClientVersion()); logBuffer.append(getClientVersion());
logBuffer.append(getSystemArchitecture()); logBuffer.append(getSystemArchitecture());
logBuffer.append(getSystemLocale()); logBuffer.append(getSystemLocale());
logBuffer.append(QString("-").repeated(75));
std::cerr << getClientVersion().toStdString() << std::endl; std::cerr << getClientVersion().toStdString() << std::endl;
std::cerr << getSystemArchitecture().toStdString() << std::endl; std::cerr << getSystemArchitecture().toStdString() << std::endl;
} }
@ -91,11 +92,12 @@ QString Logger::getSystemArchitecture()
QString result; QString result;
if (!getClientOperatingSystem().isEmpty()) { if (!getClientOperatingSystem().isEmpty()) {
result.append(tr("Client Operating System") + ": " + getClientOperatingSystem() + "\n"); // We don't want translatable strings in the 'Debug Log' for easier troubleshooting
result.append(QString("Client Operating System: ") + getClientOperatingSystem() + "\n");
} }
result.append(tr("Build Architecture") + ": " + QString::fromStdString(BUILD_ARCHITECTURE) + "\n"); result.append(QString("Build Architecture: ") + QString::fromStdString(BUILD_ARCHITECTURE) + "\n");
result.append(tr("Qt Version") + ": " + QT_VERSION_STR); result.append(QString("Qt Version: ") + QT_VERSION_STR);
return result; return result;
} }
@ -112,6 +114,6 @@ QString Logger::getClientOperatingSystem()
QString Logger::getSystemLocale() QString Logger::getSystemLocale()
{ {
QString result; QString result;
result.append(tr("System Locale") + ": " + QLocale().name()); result.append(QString("System Locale: ") + QLocale().name());
return result; return result;
} }