Logging: Add customizable logging backends and fmtlib based macros
* Change the logging backend to support multiple sinks through the Backend Interface * Add a new set of logging macros to use fmtlib instead. * Qt: Compile as GUI application on windows to make the console hidden by default. Add filter configuration and a button to open log location. * SDL: Migrate to the new logging macros
This commit is contained in:
parent
3cda637cb1
commit
0daac3020e
25 changed files with 527 additions and 140 deletions
34
src/citra_qt/debugger/console.cpp
Normal file
34
src/citra_qt/debugger/console.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Copyright 2018 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
#include <wincon.h>
|
||||
#endif
|
||||
|
||||
#include "citra_qt/debugger/console.h"
|
||||
#include "citra_qt/ui_settings.h"
|
||||
|
||||
namespace Debugger {
|
||||
void ToggleConsole() {
|
||||
#ifdef _WIN32
|
||||
if (UISettings::values.show_console) {
|
||||
if (AllocConsole()) {
|
||||
freopen_s((FILE**)stdin, "CONIN$", "r", stdin);
|
||||
freopen_s((FILE**)stdout, "CONOUT$", "w", stdout);
|
||||
freopen_s((FILE**)stderr, "CONOUT$", "w", stderr);
|
||||
}
|
||||
} 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
|
||||
freopen_s((FILE**)stdin, "NUL", "r", stdin);
|
||||
freopen_s((FILE**)stdout, "NUL", "w", stdout);
|
||||
freopen_s((FILE**)stderr, "NUL", "w", stderr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} // namespace Debugger
|
Loading…
Add table
Add a link
Reference in a new issue