[common/logging] Simplify logging logic and fix issues when logging before system is created (#3688)
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run

- our logging code was bigger than spdlog itself, why???? just keep it simple
- fix issues when logging before logging system is even started
- removes the "initialized logging twice" issue
- removes uneeded indirection in file logging
- uses direct formatting instead of jumping hoopla-around the fmt::format() ressult
- code duplication and dead code removal as usual

I did explore dup2() but I think it's not worth the hassle
I did try `fwopen()` but it's better if things are just kept as-is.

there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file

now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING

Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: DraVee <chimera@dravee.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2026-03-12 18:29:15 +01:00 • committed by crueter
parent 2896fa3835
commit 395613b01f
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
282 changed files with 1355 additions and 1457 deletions

View file

@ -7,7 +7,7 @@
#include <QKeyEvent>
#include <QScreen>
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/settings.h"
#include "common/string_util.h"
#include "core/core.h"

View file

@ -7,7 +7,7 @@
#include <QDesktopServices>
#include <QUrl>
#include "common/logging/log.h"
#include "common/logging.h"
#ifdef YUZU_USE_QT_WEB_ENGINE
#include <bit>

View file

@ -27,7 +27,7 @@
#include <qobjectdefs.h>
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/polyfill_thread.h"
#include "common/thread.h"
#include "core/frontend/emu_window.h"

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2017 Citra Emulator Project
@ -8,7 +8,7 @@
#include <QMessageBox>
#include <QPushButton>
#include <qtconcurrentrun.h>
#include "common/logging/log.h"
#include "common/logging.h"
#include "ui_compatdb.h"
#include "yuzu/compatdb.h"

View file

@ -8,8 +8,7 @@
#include <QMessageBox>
#include <QUrl>
#include "common/fs/path_util.h"
#include "common/logging/backend.h"
#include "common/logging/filter.h"
#include "common/logging.h"
#include "common/settings.h"
#include "core/core.h"
#include "core/crypto/key_manager.h"

View file

@ -5,7 +5,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <memory>
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/settings.h"
#include "common/settings_enums.h"
#include "core/core.h"

View file

@ -35,7 +35,7 @@
#include "common/common_types.h"
#include "common/dynamic_library.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/settings.h"
#include "common/settings_enums.h"
#include "core/core.h"

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2018 Citra Emulator Project
@ -10,7 +10,7 @@
#include <QMessageBox>
#include <QStringListModel>
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/settings.h"
#include "input_common/drivers/udp_client.h"
#include "input_common/helpers/udp_protocol.h"

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -5,7 +8,7 @@
#include "common/fs/fs.h"
#include "common/fs/path_util.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "frontend_common/config.h"
#include "yuzu/configuration/input_profiles.h"

View file

@ -42,7 +42,7 @@
#include "common/assert.h"
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/settings.h"
#include "common/settings_common.h"
#include "qt_common/config/shared_translation.h"

View file

@ -10,7 +10,8 @@
#include <wincon.h>
#endif
#include "common/logging/backend.h"
#include "common/logging.h"
#include "yuzu/debugger/console.h"
#include "qt_common/config/uisettings.h"
#include "yuzu/debugger/console.h"

View file

@ -21,7 +21,7 @@
#include <fmt/ranges.h>
#include <qnamespace.h>
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/settings.h"
#include "core/core.h"
#include "core/file_sys/patch_manager.h"

View file

@ -20,7 +20,7 @@
#include <QWidget>
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/string_util.h"
#include "frontend_common/play_time_manager.h"
#include "qt_common/config/uisettings.h"

View file

@ -112,7 +112,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
// Common //
#include "common/fs/fs.h"
#include "common/logging/backend.h"
#include "common/logging.h"
#include "common/memory_detect.h"
#include "common/scm_rev.h"
#include "common/scope_exit.h"

View file

@ -17,7 +17,7 @@
#include <QTime>
#include <QUrl>
#include <QtConcurrentRun>
#include "common/logging/log.h"
#include "common/logging.h"
#include "network/announce_multiplayer_session.h"
#include "ui_chat_room.h"
#include "yuzu/game/game_list_p.h"

View file

@ -11,7 +11,7 @@
#include <QMetaType>
#include <QTime>
#include <QtConcurrentRun>
#include "common/logging/log.h"
#include "common/logging.h"
#include "network/announce_multiplayer_session.h"
#include "ui_client_room.h"
#include "yuzu/game/game_list_p.h"

View file

@ -13,7 +13,7 @@
#include <QMetaType>
#include <QTime>
#include <QtConcurrentRun>
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/settings.h"
#include "core/core.h"
#include "core/internal_network/network_interface.h"

View file

@ -7,7 +7,7 @@
#include <QInputDialog>
#include <QList>
#include <QtConcurrentRun>
#include "common/logging/log.h"
#include "common/logging.h"
#include "common/settings.h"
#include "core/core.h"
#include "core/hle/service/acc/profile_manager.h"

View file

@ -9,7 +9,7 @@
#include <QMessageBox>
#include <QStandardItemModel>
#include "common/announce_multiplayer_room.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "core/core.h"
#include "qt_common/config/uisettings.h"
#include "yuzu/game/game_list.h"

View file

@ -8,7 +8,7 @@
#include <QPainter>
#include "applets/qt_profile_select.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "core/frontend/applets/profile_select.h"
#include "core/hle/service/acc/profile_manager.h"
#include "frontend_common/data_manager.h"

View file

@ -10,7 +10,7 @@
#include "qt_common/qt_common.h"
#include "common/dynamic_library.h"
#include "common/logging/log.h"
#include "common/logging.h"
#include "video_core/vulkan_common/vulkan_device.h"
#include "video_core/vulkan_common/vulkan_instance.h"
#include "video_core/vulkan_common/vulkan_library.h"