citra_qt: Migrate logging macros

Follow-up of #3533

Replace prefix of all logging macros from LOG to NGLOG
This commit is contained in:
Daniel Lim Wee Soong 2018-03-25 13:00:36 +08:00
parent 9283053701
commit 79b0e62455
4 changed files with 21 additions and 25 deletions

View file

@ -41,7 +41,7 @@ void CompatDB::Submit() {
} }
break; break;
case CompatDBPage::Final: case CompatDBPage::Final:
LOG_DEBUG(Frontend, "Compatibility Rating: %d", compatibility->checkedId()); NGLOG_DEBUG(Frontend, "Compatibility Rating: {}", compatibility->checkedId());
Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility", Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility",
compatibility->checkedId()); compatibility->checkedId());
// older versions of QT don't support the "NoCancelButtonOnLastPage" option, this is a // older versions of QT don't support the "NoCancelButtonOnLastPage" option, this is a
@ -49,7 +49,7 @@ void CompatDB::Submit() {
button(QWizard::CancelButton)->setVisible(false); button(QWizard::CancelButton)->setVisible(false);
break; break;
default: default:
LOG_ERROR(Frontend, "Unexpected page: %d", currentId()); NGLOG_ERROR(Frontend, "Unexpected page: {}", currentId());
} }
} }

View file

@ -340,7 +340,7 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) { void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) {
if (!FileUtil::Exists(dir_path.toStdString()) || if (!FileUtil::Exists(dir_path.toStdString()) ||
!FileUtil::IsDirectory(dir_path.toStdString())) { !FileUtil::IsDirectory(dir_path.toStdString())) {
LOG_ERROR(Frontend, "Could not find game list folder at %s", dir_path.toLocal8Bit().data()); NGLOG_ERROR(Frontend, "Could not find game list folder at {}", dir_path.toStdString());
search_field->setFilterResult(0, 0); search_field->setFilterResult(0, 0);
return; return;
} }
@ -390,7 +390,7 @@ static bool HasSupportedFileExtension(const std::string& file_name) {
void GameList::RefreshGameDirectory() { void GameList::RefreshGameDirectory() {
if (!UISettings::values.gamedir.isEmpty() && current_worker != nullptr) { if (!UISettings::values.gamedir.isEmpty() && current_worker != nullptr) {
LOG_INFO(Frontend, "Change detected in the games directory. Reloading game list."); NGLOG_INFO(Frontend, "Change detected in the games directory. Reloading game list.");
search_field->clear(); search_field->clear();
PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan);
} }

View file

@ -2,7 +2,6 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <cinttypes>
#include <clocale> #include <clocale>
#include <memory> #include <memory>
#include <thread> #include <thread>
@ -470,20 +469,20 @@ void GMainWindow::OnCheckForUpdates() {
void GMainWindow::CheckForUpdates() { void GMainWindow::CheckForUpdates() {
if (updater->CheckForUpdates()) { if (updater->CheckForUpdates()) {
LOG_INFO(Frontend, "Update check started"); NGLOG_INFO(Frontend, "Update check started");
} else { } else {
LOG_WARNING(Frontend, "Unable to start check for updates"); NGLOG_WARNING(Frontend, "Unable to start check for updates");
} }
} }
void GMainWindow::OnUpdateFound(bool found, bool error) { void GMainWindow::OnUpdateFound(bool found, bool error) {
if (error) { if (error) {
LOG_WARNING(Frontend, "Update check failed"); NGLOG_WARNING(Frontend, "Update check failed");
return; return;
} }
if (!found) { if (!found) {
LOG_INFO(Frontend, "No updates found"); NGLOG_INFO(Frontend, "No updates found");
// If the user explicitly clicked the "Check for Updates" button, we are // If the user explicitly clicked the "Check for Updates" button, we are
// going to want to show them a prompt anyway. // going to want to show them a prompt anyway.
@ -495,12 +494,12 @@ void GMainWindow::OnUpdateFound(bool found, bool error) {
} }
if (emulation_running && !explicit_update_check) { if (emulation_running && !explicit_update_check) {
LOG_INFO(Frontend, "Update found, deferring as game is running"); NGLOG_INFO(Frontend, "Update found, deferring as game is running");
defer_update_prompt = true; defer_update_prompt = true;
return; return;
} }
LOG_INFO(Frontend, "Update found!"); NGLOG_INFO(Frontend, "Update found!");
explicit_update_check = false; explicit_update_check = false;
ShowUpdatePrompt(); ShowUpdatePrompt();
@ -552,14 +551,13 @@ bool GMainWindow::LoadROM(const QString& filename) {
if (result != Core::System::ResultStatus::Success) { if (result != Core::System::ResultStatus::Success) {
switch (result) { switch (result) {
case Core::System::ResultStatus::ErrorGetLoader: case Core::System::ResultStatus::ErrorGetLoader:
LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", NGLOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filename.toStdString());
filename.toStdString().c_str());
QMessageBox::critical(this, tr("Error while loading ROM!"), QMessageBox::critical(this, tr("Error while loading ROM!"),
tr("The ROM format is not supported.")); tr("The ROM format is not supported."));
break; break;
case Core::System::ResultStatus::ErrorSystemMode: case Core::System::ResultStatus::ErrorSystemMode:
LOG_CRITICAL(Frontend, "Failed to load ROM!"); NGLOG_CRITICAL(Frontend, "Failed to load ROM!");
QMessageBox::critical(this, tr("Error while loading ROM!"), QMessageBox::critical(this, tr("Error while loading ROM!"),
tr("Could not determine the system mode.")); tr("Could not determine the system mode."));
break; break;
@ -610,7 +608,7 @@ bool GMainWindow::LoadROM(const QString& filename) {
} }
void GMainWindow::BootGame(const QString& filename) { void GMainWindow::BootGame(const QString& filename) {
LOG_INFO(Frontend, "Citra starting..."); NGLOG_INFO(Frontend, "Citra starting...");
StoreRecentFile(filename); // Put the filename on top of the list StoreRecentFile(filename); // Put the filename on top of the list
if (!LoadROM(filename)) if (!LoadROM(filename))
@ -754,7 +752,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
"content/"; "content/";
break; break;
default: default:
LOG_ERROR(Frontend, "Unexpected target %d", target); NGLOG_ERROR(Frontend, "Unexpected target {}", static_cast<int>(target));
return; return;
} }
@ -768,8 +766,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
return; return;
} }
LOG_INFO(Frontend, "Opening %s path for program_id=%016" PRIx64, open_target.c_str(), NGLOG_INFO(Frontend, "Opening {} path for program_id={:#016}", open_target, program_id);
program_id);
QDesktopServices::openUrl(QUrl::fromLocalFile(qpath)); QDesktopServices::openUrl(QUrl::fromLocalFile(qpath));
} }
@ -1233,7 +1230,7 @@ void GMainWindow::UpdateUITheme() {
QString theme_uri(":" + UISettings::values.theme + "/style.qss"); QString theme_uri(":" + UISettings::values.theme + "/style.qss");
QFile f(theme_uri); QFile f(theme_uri);
if (!f.exists()) { if (!f.exists()) {
LOG_ERROR(Frontend, "Unable to set style, stylesheet file not found"); NGLOG_ERROR(Frontend, "Unable to set style, stylesheet file not found");
} else { } else {
f.open(QFile::ReadOnly | QFile::Text); f.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&f); QTextStream ts(&f);

View file

@ -211,8 +211,7 @@ XMLParseResult UpdaterPrivate::ParseResult(const QByteArray& output,
} }
if (reader.hasError()) { if (reader.hasError()) {
LOG_ERROR(Frontend, "Cannot read xml for update: %s", NGLOG_ERROR(Frontend, "Cannot read xml for update: {}", reader.errorString().toStdString());
reader.errorString().toStdString().c_str());
return XMLParseResult::InvalidXML; return XMLParseResult::InvalidXML;
} }
@ -276,18 +275,18 @@ void UpdaterPrivate::LaunchWithArguments(const QStringList& args) {
QFileInfo tool_info(QCoreApplication::applicationDirPath(), tool_path); QFileInfo tool_info(QCoreApplication::applicationDirPath(), tool_path);
if (!QProcess::startDetached(tool_info.absoluteFilePath(), args, tool_info.absolutePath())) { if (!QProcess::startDetached(tool_info.absoluteFilePath(), args, tool_info.absolutePath())) {
LOG_WARNING(Frontend, "Unable to start program %s", NGLOG_WARNING(Frontend, "Unable to start program {}",
tool_info.absoluteFilePath().toStdString().c_str()); tool_info.absoluteFilePath().toStdString());
} }
} }
void UpdaterPrivate::LaunchUI() { void UpdaterPrivate::LaunchUI() {
LOG_INFO(Frontend, "Launching update UI..."); NGLOG_INFO(Frontend, "Launching update UI...");
LaunchWithArguments(run_arguments); LaunchWithArguments(run_arguments);
} }
void UpdaterPrivate::SilentlyUpdate() { void UpdaterPrivate::SilentlyUpdate() {
LOG_INFO(Frontend, "Launching silent update..."); NGLOG_INFO(Frontend, "Launching silent update...");
LaunchWithArguments(silent_arguments); LaunchWithArguments(silent_arguments);
} }