summaryrefslogtreecommitdiff
path: root/src/citra/citra.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra/citra.cpp')
-rw-r--r--src/citra/citra.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index f2aeb510e..7c031ce8d 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -2,8 +2,12 @@
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/scope_exit.h"
7 11
8#include "core/settings.h" 12#include "core/settings.h"
9#include "core/system.h" 13#include "core/system.h"
@@ -15,7 +19,12 @@
15 19
16/// Application entry point 20/// Application entry point
17int __cdecl main(int argc, char **argv) { 21int __cdecl main(int argc, char **argv) {
18 LogManager::Init(); 22 std::shared_ptr<Log::Logger> logger = Log::InitGlobalLogger();
23 std::thread logging_thread(Log::TextLoggingLoop, logger);
24 SCOPE_EXIT({
25 logger->Close();
26 logging_thread.join();
27 });
19 28
20 if (argc < 2) { 29 if (argc < 2) {
21 ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified"); 30 ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified");
@@ -24,9 +33,6 @@ int __cdecl main(int argc, char **argv) {
24 33
25 Config config; 34 Config config;
26 35
27 if (!Settings::values.enable_log)
28 LogManager::Shutdown();
29
30 std::string boot_filename = argv[1]; 36 std::string boot_filename = argv[1];
31 EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; 37 EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
32 38