diff options
Diffstat (limited to 'src/citra/citra.cpp')
| -rw-r--r-- | src/citra/citra.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index f2aeb510e..d6e8a4ec7 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp | |||
| @@ -2,8 +2,13 @@ | |||
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <thread> | ||
| 6 | |||
| 5 | #include "common/common.h" | 7 | #include "common/common.h" |
| 6 | #include "common/log_manager.h" | 8 | #include "common/logging/text_formatter.h" |
| 9 | #include "common/logging/backend.h" | ||
| 10 | #include "common/logging/filter.h" | ||
| 11 | #include "common/scope_exit.h" | ||
| 7 | 12 | ||
| 8 | #include "core/settings.h" | 13 | #include "core/settings.h" |
| 9 | #include "core/system.h" | 14 | #include "core/system.h" |
| @@ -15,17 +20,21 @@ | |||
| 15 | 20 | ||
| 16 | /// Application entry point | 21 | /// Application entry point |
| 17 | int __cdecl main(int argc, char **argv) { | 22 | int __cdecl main(int argc, char **argv) { |
| 18 | LogManager::Init(); | 23 | std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger(); |
| 24 | Log::Filter log_filter(Log::Level::Debug); | ||
| 25 | std::thread logging_thread(Log::TextLoggingLoop, logger, &log_filter); | ||
| 26 | SCOPE_EXIT({ | ||
| 27 | logger->Close(); | ||
| 28 | logging_thread.join(); | ||
| 29 | }); | ||
| 19 | 30 | ||
| 20 | if (argc < 2) { | 31 | if (argc < 2) { |
| 21 | ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified"); | 32 | LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); |
| 22 | return -1; | 33 | return -1; |
| 23 | } | 34 | } |
| 24 | 35 | ||
| 25 | Config config; | 36 | Config config; |
| 26 | 37 | log_filter.ParseFilterString(Settings::values.log_filter); | |
| 27 | if (!Settings::values.enable_log) | ||
| 28 | LogManager::Shutdown(); | ||
| 29 | 38 | ||
| 30 | std::string boot_filename = argv[1]; | 39 | std::string boot_filename = argv[1]; |
| 31 | EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; | 40 | EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; |
| @@ -34,7 +43,7 @@ int __cdecl main(int argc, char **argv) { | |||
| 34 | 43 | ||
| 35 | Loader::ResultStatus load_result = Loader::LoadFile(boot_filename); | 44 | Loader::ResultStatus load_result = Loader::LoadFile(boot_filename); |
| 36 | if (Loader::ResultStatus::Success != load_result) { | 45 | if (Loader::ResultStatus::Success != load_result) { |
| 37 | ERROR_LOG(BOOT, "Failed to load ROM (Error %i)!", load_result); | 46 | LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result); |
| 38 | return -1; | 47 | return -1; |
| 39 | } | 48 | } |
| 40 | 49 | ||