diff options
Diffstat (limited to 'src/yuzu_cmd/yuzu.cpp')
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 24db1065a..b5392c499 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -56,6 +56,18 @@ static void PrintVersion() { | |||
| 56 | std::cout << "yuzu " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl; | 56 | std::cout << "yuzu " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | static void InitializeLogging() { | ||
| 60 | Log::Filter log_filter(Log::Level::Debug); | ||
| 61 | log_filter.ParseFilterString(Settings::values.log_filter); | ||
| 62 | Log::SetGlobalFilter(log_filter); | ||
| 63 | |||
| 64 | Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>()); | ||
| 65 | |||
| 66 | const std::string& log_dir = FileUtil::GetUserPath(FileUtil::UserPath::LogDir); | ||
| 67 | FileUtil::CreateFullPath(log_dir); | ||
| 68 | Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE)); | ||
| 69 | } | ||
| 70 | |||
| 59 | /// Application entry point | 71 | /// Application entry point |
| 60 | int main(int argc, char** argv) { | 72 | int main(int argc, char** argv) { |
| 61 | Config config; | 73 | Config config; |
| @@ -124,14 +136,7 @@ int main(int argc, char** argv) { | |||
| 124 | LocalFree(argv_w); | 136 | LocalFree(argv_w); |
| 125 | #endif | 137 | #endif |
| 126 | 138 | ||
| 127 | Log::Filter log_filter(Log::Level::Debug); | 139 | InitializeLogging(); |
| 128 | log_filter.ParseFilterString(Settings::values.log_filter); | ||
| 129 | Log::SetGlobalFilter(log_filter); | ||
| 130 | |||
| 131 | Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>()); | ||
| 132 | FileUtil::CreateFullPath(FileUtil::GetUserPath(D_LOGS_IDX)); | ||
| 133 | Log::AddBackend( | ||
| 134 | std::make_unique<Log::FileBackend>(FileUtil::GetUserPath(D_LOGS_IDX) + LOG_FILE)); | ||
| 135 | 140 | ||
| 136 | MicroProfileOnThreadCreate("EmuThread"); | 141 | MicroProfileOnThreadCreate("EmuThread"); |
| 137 | SCOPE_EXIT({ MicroProfileShutdown(); }); | 142 | SCOPE_EXIT({ MicroProfileShutdown(); }); |