summaryrefslogtreecommitdiffstats
path: root/src/yuzu/debugger/console.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/debugger/console.cpp')
-rw-r--r--src/yuzu/debugger/console.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/yuzu/debugger/console.cpp b/src/yuzu/debugger/console.cpp
index 22ca1285d..f89ea8ea7 100644
--- a/src/yuzu/debugger/console.cpp
+++ b/src/yuzu/debugger/console.cpp
@@ -21,6 +21,7 @@ void ToggleConsole() {
console_shown = UISettings::values.show_console.GetValue();
}
+ using namespace Common::Log;
#if defined(_WIN32) && !defined(_DEBUG)
FILE* temp;
if (UISettings::values.show_console) {
@@ -29,24 +30,20 @@ void ToggleConsole() {
freopen_s(&temp, "CONIN$", "r", stdin);
freopen_s(&temp, "CONOUT$", "w", stdout);
freopen_s(&temp, "CONOUT$", "w", stderr);
- Common::Log::AddBackend(std::make_unique<Common::Log::ColorConsoleBackend>());
+ SetColorConsoleBackendEnabled(true);
}
} else {
if (FreeConsole()) {
// In order to close the console, we have to also detach the streams on it.
// Just redirect them to NUL if there is no console window
- Common::Log::RemoveBackend(Common::Log::ColorConsoleBackend::Name());
+ SetColorConsoleBackendEnabled(false);
freopen_s(&temp, "NUL", "r", stdin);
freopen_s(&temp, "NUL", "w", stdout);
freopen_s(&temp, "NUL", "w", stderr);
}
}
#else
- if (UISettings::values.show_console) {
- Common::Log::AddBackend(std::make_unique<Common::Log::ColorConsoleBackend>());
- } else {
- Common::Log::RemoveBackend(Common::Log::ColorConsoleBackend::Name());
- }
+ SetColorConsoleBackendEnabled(UISettings::values.show_console.GetValue());
#endif
}
} // namespace Debugger