Просмотр исходного кода

Merge pull request #650 from jroweboy/logging-stuff

Minor logging fixes
bunnei 8 лет назад
Родитель
Сommit
b89fb430c7
3 измененных файлов с 8 добавлено и 4 удалено
  1. 7 0
      src/yuzu/debugger/console.cpp
  2. 0 2
      src/yuzu/main.cpp
  3. 1 2
      src/yuzu_cmd/yuzu.cpp

+ 7 - 0
src/yuzu/debugger/console.cpp

@@ -14,6 +14,13 @@
 
 
 namespace Debugger {
 namespace Debugger {
 void ToggleConsole() {
 void ToggleConsole() {
+    static bool console_shown = false;
+    if (console_shown == UISettings::values.show_console) {
+        return;
+    } else {
+        console_shown = UISettings::values.show_console;
+    }
+
 #if defined(_WIN32) && !defined(_DEBUG)
 #if defined(_WIN32) && !defined(_DEBUG)
     FILE* temp;
     FILE* temp;
     if (UISettings::values.show_console) {
     if (UISettings::values.show_console) {

+ 0 - 2
src/yuzu/main.cpp

@@ -908,8 +908,6 @@ void GMainWindow::UpdateUITheme() {
 #endif
 #endif
 
 
 int main(int argc, char* argv[]) {
 int main(int argc, char* argv[]) {
-    Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>());
-
     MicroProfileOnThreadCreate("Frontend");
     MicroProfileOnThreadCreate("Frontend");
     SCOPE_EXIT({ MicroProfileShutdown(); });
     SCOPE_EXIT({ MicroProfileShutdown(); });
 
 

+ 1 - 2
src/yuzu_cmd/yuzu.cpp

@@ -127,6 +127,7 @@ int main(int argc, char** argv) {
 #endif
 #endif
 
 
     Log::Filter log_filter(Log::Level::Debug);
     Log::Filter log_filter(Log::Level::Debug);
+    log_filter.ParseFilterString(Settings::values.log_filter);
     Log::SetGlobalFilter(log_filter);
     Log::SetGlobalFilter(log_filter);
 
 
     Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>());
     Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>());
@@ -142,8 +143,6 @@ int main(int argc, char** argv) {
         return -1;
         return -1;
     }
     }
 
 
-    log_filter.ParseFilterString(Settings::values.log_filter);
-
     // Apply the command line arguments
     // Apply the command line arguments
     Settings::values.gdbstub_port = gdb_port;
     Settings::values.gdbstub_port = gdb_port;
     Settings::values.use_gdbstub = use_gdbstub;
     Settings::values.use_gdbstub = use_gdbstub;