summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/yuzu/main.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index c62360bd4..98a41a725 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -91,9 +91,20 @@ void GMainWindow::ShowCallouts() {}
91 91
92const int GMainWindow::max_recent_files_item; 92const int GMainWindow::max_recent_files_item;
93 93
94static void InitializeLogging() {
95 Log::Filter log_filter;
96 log_filter.ParseFilterString(Settings::values.log_filter);
97 Log::SetGlobalFilter(log_filter);
98
99 const std::string& log_dir = FileUtil::GetUserPath(FileUtil::UserPath::LogDir);
100 FileUtil::CreateFullPath(log_dir);
101 Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE));
102}
103
94GMainWindow::GMainWindow() 104GMainWindow::GMainWindow()
95 : config(new Config()), emu_thread(nullptr), 105 : config(new Config()), emu_thread(nullptr),
96 vfs(std::make_shared<FileSys::RealVfsFilesystem>()) { 106 vfs(std::make_shared<FileSys::RealVfsFilesystem>()) {
107 InitializeLogging();
97 108
98 debug_context = Tegra::DebugContext::Construct(); 109 debug_context = Tegra::DebugContext::Construct();
99 110
@@ -1173,16 +1184,6 @@ void GMainWindow::UpdateUITheme() {
1173#undef main 1184#undef main
1174#endif 1185#endif
1175 1186
1176static void InitializeLogging() {
1177 Log::Filter log_filter;
1178 log_filter.ParseFilterString(Settings::values.log_filter);
1179 Log::SetGlobalFilter(log_filter);
1180
1181 const std::string& log_dir = FileUtil::GetUserPath(FileUtil::UserPath::LogDir);
1182 FileUtil::CreateFullPath(log_dir);
1183 Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE));
1184}
1185
1186int main(int argc, char* argv[]) { 1187int main(int argc, char* argv[]) {
1187 MicroProfileOnThreadCreate("Frontend"); 1188 MicroProfileOnThreadCreate("Frontend");
1188 SCOPE_EXIT({ MicroProfileShutdown(); }); 1189 SCOPE_EXIT({ MicroProfileShutdown(); });
@@ -1200,7 +1201,6 @@ int main(int argc, char* argv[]) {
1200 1201
1201 GMainWindow main_window; 1202 GMainWindow main_window;
1202 // After settings have been loaded by GMainWindow, apply the filter 1203 // After settings have been loaded by GMainWindow, apply the filter
1203 InitializeLogging();
1204 main_window.show(); 1204 main_window.show();
1205 return app.exec(); 1205 return app.exec();
1206} 1206}