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:
James Rowe 2018-02-19 17:51:27 -07:00 committed by Daniel Lim Wee Soong
parent 3cda637cb1
commit 0daac3020e
25 changed files with 527 additions and 140 deletions

View file

@ -66,7 +66,7 @@ EmuWindow_SDL2::EmuWindow_SDL2() {
// Initialize the window
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting...");
NGLOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting...");
exit(1);
}
@ -89,19 +89,19 @@ EmuWindow_SDL2::EmuWindow_SDL2() {
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
if (render_window == nullptr) {
LOG_CRITICAL(Frontend, "Failed to create SDL2 window: %s", SDL_GetError());
NGLOG_CRITICAL(Frontend, "Failed to create SDL2 window: {}", SDL_GetError());
exit(1);
}
gl_context = SDL_GL_CreateContext(render_window);
if (gl_context == nullptr) {
LOG_CRITICAL(Frontend, "Failed to create SDL2 GL context: %s", SDL_GetError());
NGLOG_CRITICAL(Frontend, "Failed to create SDL2 GL context: {}", SDL_GetError());
exit(1);
}
if (!gladLoadGLLoader(static_cast<GLADloadproc>(SDL_GL_GetProcAddress))) {
LOG_CRITICAL(Frontend, "Failed to initialize GL functions: %s", SDL_GetError());
NGLOG_CRITICAL(Frontend, "Failed to initialize GL functions: {}", SDL_GetError());
exit(1);
}