diff options
Diffstat (limited to 'src/citra_qt')
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 8 | ||||
| -rw-r--r-- | src/citra_qt/config.cpp | 4 | ||||
| -rw-r--r-- | src/citra_qt/debugger/graphics_breakpoints.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 33 | ||||
| -rw-r--r-- | src/citra_qt/util/spinbox.cpp | 2 |
5 files changed, 31 insertions, 18 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index b53206be6..6d08d6afc 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp | |||
| @@ -62,7 +62,7 @@ void EmuThread::Stop() | |||
| 62 | { | 62 | { |
| 63 | if (!isRunning()) | 63 | if (!isRunning()) |
| 64 | { | 64 | { |
| 65 | INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning..."); | 65 | LOG_WARNING(Frontend, "EmuThread::Stop called while emu thread wasn't running, returning..."); |
| 66 | return; | 66 | return; |
| 67 | } | 67 | } |
| 68 | stop_run = true; | 68 | stop_run = true; |
| @@ -76,7 +76,7 @@ void EmuThread::Stop() | |||
| 76 | wait(1000); | 76 | wait(1000); |
| 77 | if (isRunning()) | 77 | if (isRunning()) |
| 78 | { | 78 | { |
| 79 | WARN_LOG(MASTER_LOG, "EmuThread still running, terminating..."); | 79 | LOG_WARNING(Frontend, "EmuThread still running, terminating..."); |
| 80 | quit(); | 80 | quit(); |
| 81 | 81 | ||
| 82 | // TODO: Waiting 50 seconds can be necessary if the logging subsystem has a lot of spam | 82 | // TODO: Waiting 50 seconds can be necessary if the logging subsystem has a lot of spam |
| @@ -84,11 +84,11 @@ void EmuThread::Stop() | |||
| 84 | wait(50000); | 84 | wait(50000); |
| 85 | if (isRunning()) | 85 | if (isRunning()) |
| 86 | { | 86 | { |
| 87 | WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here..."); | 87 | LOG_CRITICAL(Frontend, "EmuThread STILL running, something is wrong here..."); |
| 88 | terminate(); | 88 | terminate(); |
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | INFO_LOG(MASTER_LOG, "EmuThread stopped"); | 91 | LOG_INFO(Frontend, "EmuThread stopped"); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | 94 | ||
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 3209e5900..0ae6b8b2d 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp | |||
| @@ -52,7 +52,7 @@ void Config::ReadValues() { | |||
| 52 | qt_config->endGroup(); | 52 | qt_config->endGroup(); |
| 53 | 53 | ||
| 54 | qt_config->beginGroup("Miscellaneous"); | 54 | qt_config->beginGroup("Miscellaneous"); |
| 55 | Settings::values.enable_log = qt_config->value("enable_log", true).toBool(); | 55 | Settings::values.log_filter = qt_config->value("log_filter", "*:Info").toString().toStdString(); |
| 56 | qt_config->endGroup(); | 56 | qt_config->endGroup(); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| @@ -87,7 +87,7 @@ void Config::SaveValues() { | |||
| 87 | qt_config->endGroup(); | 87 | qt_config->endGroup(); |
| 88 | 88 | ||
| 89 | qt_config->beginGroup("Miscellaneous"); | 89 | qt_config->beginGroup("Miscellaneous"); |
| 90 | qt_config->setValue("enable_log", Settings::values.enable_log); | 90 | qt_config->setValue("log_filter", QString::fromStdString(Settings::values.log_filter)); |
| 91 | qt_config->endGroup(); | 91 | qt_config->endGroup(); |
| 92 | } | 92 | } |
| 93 | 93 | ||
diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp index df5579e15..53394b6e6 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics_breakpoints.cpp | |||
| @@ -45,7 +45,7 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const | |||
| 45 | map.insert({Pica::DebugContext::Event::IncomingPrimitiveBatch, tr("Incoming primitive batch")}); | 45 | map.insert({Pica::DebugContext::Event::IncomingPrimitiveBatch, tr("Incoming primitive batch")}); |
| 46 | map.insert({Pica::DebugContext::Event::FinishedPrimitiveBatch, tr("Finished primitive batch")}); | 46 | map.insert({Pica::DebugContext::Event::FinishedPrimitiveBatch, tr("Finished primitive batch")}); |
| 47 | 47 | ||
| 48 | _dbg_assert_(GUI, map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents)); | 48 | _dbg_assert_(Debug_GPU, map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents)); |
| 49 | 49 | ||
| 50 | return map[event]; | 50 | return map[event]; |
| 51 | } | 51 | } |
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index b4e3ad964..1299338ac 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | #include <thread> | ||
| 2 | |||
| 1 | #include <QtGui> | 3 | #include <QtGui> |
| 2 | #include <QDesktopWidget> | 4 | #include <QDesktopWidget> |
| 3 | #include <QFileDialog> | 5 | #include <QFileDialog> |
| @@ -5,8 +7,13 @@ | |||
| 5 | #include "main.hxx" | 7 | #include "main.hxx" |
| 6 | 8 | ||
| 7 | #include "common/common.h" | 9 | #include "common/common.h" |
| 10 | #include "common/logging/text_formatter.h" | ||
| 11 | #include "common/logging/log.h" | ||
| 12 | #include "common/logging/backend.h" | ||
| 13 | #include "common/logging/filter.h" | ||
| 8 | #include "common/platform.h" | 14 | #include "common/platform.h" |
| 9 | #include "common/log_manager.h" | 15 | #include "common/scope_exit.h" |
| 16 | |||
| 10 | #if EMU_PLATFORM == PLATFORM_LINUX | 17 | #if EMU_PLATFORM == PLATFORM_LINUX |
| 11 | #include <unistd.h> | 18 | #include <unistd.h> |
| 12 | #endif | 19 | #endif |
| @@ -33,18 +40,12 @@ | |||
| 33 | 40 | ||
| 34 | #include "version.h" | 41 | #include "version.h" |
| 35 | 42 | ||
| 36 | |||
| 37 | GMainWindow::GMainWindow() | 43 | GMainWindow::GMainWindow() |
| 38 | { | 44 | { |
| 39 | LogManager::Init(); | ||
| 40 | |||
| 41 | Pica::g_debug_context = Pica::DebugContext::Construct(); | 45 | Pica::g_debug_context = Pica::DebugContext::Construct(); |
| 42 | 46 | ||
| 43 | Config config; | 47 | Config config; |
| 44 | 48 | ||
| 45 | if (!Settings::values.enable_log) | ||
| 46 | LogManager::Shutdown(); | ||
| 47 | |||
| 48 | ui.setupUi(this); | 49 | ui.setupUi(this); |
| 49 | statusBar()->hide(); | 50 | statusBar()->hide(); |
| 50 | 51 | ||
| @@ -153,18 +154,18 @@ GMainWindow::~GMainWindow() | |||
| 153 | 154 | ||
| 154 | void GMainWindow::BootGame(std::string filename) | 155 | void GMainWindow::BootGame(std::string filename) |
| 155 | { | 156 | { |
| 156 | NOTICE_LOG(MASTER_LOG, "Citra starting...\n"); | 157 | LOG_INFO(Frontend, "Citra starting...\n"); |
| 157 | System::Init(render_window); | 158 | System::Init(render_window); |
| 158 | 159 | ||
| 159 | if (Core::Init()) { | 160 | if (Core::Init()) { |
| 160 | ERROR_LOG(MASTER_LOG, "Core initialization failed, exiting..."); | 161 | LOG_CRITICAL(Frontend, "Core initialization failed, exiting..."); |
| 161 | Core::Stop(); | 162 | Core::Stop(); |
| 162 | exit(1); | 163 | exit(1); |
| 163 | } | 164 | } |
| 164 | 165 | ||
| 165 | // Load a game or die... | 166 | // Load a game or die... |
| 166 | if (Loader::ResultStatus::Success != Loader::LoadFile(filename)) { | 167 | if (Loader::ResultStatus::Success != Loader::LoadFile(filename)) { |
| 167 | ERROR_LOG(BOOT, "Failed to load ROM!"); | 168 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); |
| 168 | } | 169 | } |
| 169 | 170 | ||
| 170 | disasmWidget->Init(); | 171 | disasmWidget->Init(); |
| @@ -271,9 +272,21 @@ void GMainWindow::closeEvent(QCloseEvent* event) | |||
| 271 | 272 | ||
| 272 | int __cdecl main(int argc, char* argv[]) | 273 | int __cdecl main(int argc, char* argv[]) |
| 273 | { | 274 | { |
| 275 | std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger(); | ||
| 276 | Log::Filter log_filter(Log::Level::Info); | ||
| 277 | std::thread logging_thread(Log::TextLoggingLoop, logger, &log_filter); | ||
| 278 | SCOPE_EXIT({ | ||
| 279 | logger->Close(); | ||
| 280 | logging_thread.join(); | ||
| 281 | }); | ||
| 282 | |||
| 274 | QApplication::setAttribute(Qt::AA_X11InitThreads); | 283 | QApplication::setAttribute(Qt::AA_X11InitThreads); |
| 275 | QApplication app(argc, argv); | 284 | QApplication app(argc, argv); |
| 285 | |||
| 276 | GMainWindow main_window; | 286 | GMainWindow main_window; |
| 287 | // After settings have been loaded by GMainWindow, apply the filter | ||
| 288 | log_filter.ParseFilterString(Settings::values.log_filter); | ||
| 289 | |||
| 277 | main_window.show(); | 290 | main_window.show(); |
| 278 | return app.exec(); | 291 | return app.exec(); |
| 279 | } | 292 | } |
diff --git a/src/citra_qt/util/spinbox.cpp b/src/citra_qt/util/spinbox.cpp index 80dc67d7d..9672168f5 100644 --- a/src/citra_qt/util/spinbox.cpp +++ b/src/citra_qt/util/spinbox.cpp | |||
| @@ -244,7 +244,7 @@ QValidator::State CSpinBox::validate(QString& input, int& pos) const | |||
| 244 | if (strpos >= input.length() - HasSign() - suffix.length()) | 244 | if (strpos >= input.length() - HasSign() - suffix.length()) |
| 245 | return QValidator::Intermediate; | 245 | return QValidator::Intermediate; |
| 246 | 246 | ||
| 247 | _dbg_assert_(GUI, base <= 10 || base == 16); | 247 | _dbg_assert_(Frontend, base <= 10 || base == 16); |
| 248 | QString regexp; | 248 | QString regexp; |
| 249 | 249 | ||
| 250 | // Demand sign character for negative ranges | 250 | // Demand sign character for negative ranges |