diff options
Diffstat (limited to 'src/yuzu_cmd/yuzu.cpp')
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 95e568b7b..8ddd202d8 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <string> | 7 | #include <string> |
| 8 | #include <thread> | 8 | #include <thread> |
| 9 | 9 | ||
| 10 | #include "common/common_paths.h" | ||
| 10 | #include "common/logging/backend.h" | 11 | #include "common/logging/backend.h" |
| 11 | #include "common/logging/filter.h" | 12 | #include "common/logging/filter.h" |
| 12 | #include "common/logging/log.h" | 13 | #include "common/logging/log.h" |
| @@ -69,7 +70,7 @@ int main(int argc, char** argv) { | |||
| 69 | auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); | 70 | auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); |
| 70 | 71 | ||
| 71 | if (argv_w == nullptr) { | 72 | if (argv_w == nullptr) { |
| 72 | NGLOG_CRITICAL(Frontend, "Failed to get command line arguments"); | 73 | LOG_CRITICAL(Frontend, "Failed to get command line arguments"); |
| 73 | return -1; | 74 | return -1; |
| 74 | } | 75 | } |
| 75 | #endif | 76 | #endif |
| @@ -102,7 +103,7 @@ int main(int argc, char** argv) { | |||
| 102 | break; | 103 | break; |
| 103 | case 'f': | 104 | case 'f': |
| 104 | fullscreen = true; | 105 | fullscreen = true; |
| 105 | NGLOG_INFO(Frontend, "Starting in fullscreen mode..."); | 106 | LOG_INFO(Frontend, "Starting in fullscreen mode..."); |
| 106 | break; | 107 | break; |
| 107 | case 'h': | 108 | case 'h': |
| 108 | PrintHelp(argv[0]); | 109 | PrintHelp(argv[0]); |
| @@ -126,13 +127,18 @@ int main(int argc, char** argv) { | |||
| 126 | #endif | 127 | #endif |
| 127 | 128 | ||
| 128 | Log::Filter log_filter(Log::Level::Debug); | 129 | Log::Filter log_filter(Log::Level::Debug); |
| 129 | Log::SetFilter(&log_filter); | 130 | Log::SetGlobalFilter(log_filter); |
| 131 | |||
| 132 | Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>()); | ||
| 133 | FileUtil::CreateFullPath(FileUtil::GetUserPath(D_LOGS_IDX)); | ||
| 134 | Log::AddBackend( | ||
| 135 | std::make_unique<Log::FileBackend>(FileUtil::GetUserPath(D_LOGS_IDX) + LOG_FILE)); | ||
| 130 | 136 | ||
| 131 | MicroProfileOnThreadCreate("EmuThread"); | 137 | MicroProfileOnThreadCreate("EmuThread"); |
| 132 | SCOPE_EXIT({ MicroProfileShutdown(); }); | 138 | SCOPE_EXIT({ MicroProfileShutdown(); }); |
| 133 | 139 | ||
| 134 | if (filepath.empty()) { | 140 | if (filepath.empty()) { |
| 135 | NGLOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); | 141 | LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); |
| 136 | return -1; | 142 | return -1; |
| 137 | } | 143 | } |
| 138 | 144 | ||
| @@ -153,28 +159,28 @@ int main(int argc, char** argv) { | |||
| 153 | 159 | ||
| 154 | switch (load_result) { | 160 | switch (load_result) { |
| 155 | case Core::System::ResultStatus::ErrorGetLoader: | 161 | case Core::System::ResultStatus::ErrorGetLoader: |
| 156 | NGLOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filepath.c_str()); | 162 | LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filepath.c_str()); |
| 157 | return -1; | 163 | return -1; |
| 158 | case Core::System::ResultStatus::ErrorLoader: | 164 | case Core::System::ResultStatus::ErrorLoader: |
| 159 | NGLOG_CRITICAL(Frontend, "Failed to load ROM!"); | 165 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); |
| 160 | return -1; | 166 | return -1; |
| 161 | case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: | 167 | case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: |
| 162 | NGLOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " | 168 | LOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " |
| 163 | "being used with yuzu. \n\n For more information on dumping and " | 169 | "being used with yuzu. \n\n For more information on dumping and " |
| 164 | "decrypting games, please refer to: " | 170 | "decrypting games, please refer to: " |
| 165 | "https://yuzu-emu.org/wiki/dumping-game-cartridges/"); | 171 | "https://yuzu-emu.org/wiki/dumping-game-cartridges/"); |
| 166 | return -1; | 172 | return -1; |
| 167 | case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: | 173 | case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: |
| 168 | NGLOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); | 174 | LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); |
| 169 | return -1; | 175 | return -1; |
| 170 | case Core::System::ResultStatus::ErrorNotInitialized: | 176 | case Core::System::ResultStatus::ErrorNotInitialized: |
| 171 | NGLOG_CRITICAL(Frontend, "CPUCore not initialized"); | 177 | LOG_CRITICAL(Frontend, "CPUCore not initialized"); |
| 172 | return -1; | 178 | return -1; |
| 173 | case Core::System::ResultStatus::ErrorSystemMode: | 179 | case Core::System::ResultStatus::ErrorSystemMode: |
| 174 | NGLOG_CRITICAL(Frontend, "Failed to determine system mode!"); | 180 | LOG_CRITICAL(Frontend, "Failed to determine system mode!"); |
| 175 | return -1; | 181 | return -1; |
| 176 | case Core::System::ResultStatus::ErrorVideoCore: | 182 | case Core::System::ResultStatus::ErrorVideoCore: |
| 177 | NGLOG_CRITICAL(Frontend, "VideoCore not initialized"); | 183 | LOG_CRITICAL(Frontend, "VideoCore not initialized"); |
| 178 | return -1; | 184 | return -1; |
| 179 | case Core::System::ResultStatus::Success: | 185 | case Core::System::ResultStatus::Success: |
| 180 | break; // Expected case | 186 | break; // Expected case |