diff --git a/src/common/logging/log.cpp b/src/common/logging/log.cpp index 4a1efd01e..a50090f58 100644 --- a/src/common/logging/log.cpp +++ b/src/common/logging/log.cpp @@ -184,6 +184,7 @@ void Setup(std::string_view shadps4_filename) { for (auto& [name, logger] : ALL_LOGGERS) { logger = std::make_shared(std::string(name)); + logger->set_level(spdlog::level::trace); } // Setup console @@ -209,7 +210,6 @@ void Setup(std::string_view shadps4_filename) { g_shad_file_sink->set_pattern("%^%v%$"); UpdateSinks(); - UpdateLogLevels(EmulatorSettings.GetLogFilter()); } void Switch(std::string_view game_filename) { diff --git a/src/common/logging/log.h b/src/common/logging/log.h index eb3dfa552..287d604a9 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -61,11 +61,11 @@ static constexpr std::array level_string_views{"Trace", "Debug", "Info", "War } \ } while (false) -#ifdef _DEBUG +#ifdef NDEBUG +#define LOG_TRACE(log_class, ...) (void(0)) +#else #define LOG_TRACE(log_class, ...) \ LOG_GENERIC(Common::Log::Class::log_class, spdlog::level::trace, __VA_ARGS__) -#else -#define LOG_TRACE(log_class, ...) (void(0)) #endif #define LOG_DEBUG(log_class, ...) \ diff --git a/src/core/emulator_settings.cpp b/src/core/emulator_settings.cpp index 91c305a6a..785973c22 100644 --- a/src/core/emulator_settings.cpp +++ b/src/core/emulator_settings.cpp @@ -258,7 +258,7 @@ void EmulatorSettingsImpl::ResetGameSpecificValue(const std::string& key) { return; if (tryGroup(m_vulkan)) return; - LOG_DEBUG(Config, "ResetGameSpecificValue: key '{}' not found", key); + LOG_WARNING(Config, "ResetGameSpecificValue: key '{}' not found", key); } bool EmulatorSettingsImpl::Save(const std::string& serial) { @@ -300,7 +300,7 @@ bool EmulatorSettingsImpl::Save(const std::string& serial) { std::ofstream out(path); if (!out) { - LOG_DEBUG(Config, "Failed to open game config for writing: {}", path.string()); + LOG_ERROR(Config, "Failed to open game config for writing: {}", path.string()); return false; } out << std::setw(2) << j; @@ -342,14 +342,14 @@ bool EmulatorSettingsImpl::Save(const std::string& serial) { std::ofstream out(path); if (!out) { - LOG_DEBUG(Config, "Failed to open config for writing: {}", path.string()); + LOG_ERROR(Config, "Failed to open config for writing: {}", path.string()); return false; } out << std::setw(2) << existing; return !out.fail(); } } catch (const std::exception& e) { - LOG_DEBUG(Config, "Error saving settings: {}", e.what()); + LOG_ERROR(Config, "Error saving settings: {}", e.what()); return false; } } @@ -469,7 +469,7 @@ bool EmulatorSettingsImpl::Load(const std::string& serial) { return true; } } catch (const std::exception& e) { - LOG_DEBUG(Config, "Error loading settings: {}", e.what()); + LOG_ERROR(Config, "Error loading settings: {}", e.what()); return false; } } @@ -669,7 +669,7 @@ bool EmulatorSettingsImpl::TransferSettings() { } s.install_dirs.value = settings_install_dirs; } catch (const std::exception& e) { - LOG_DEBUG(Config, "Failed to transfer install directories: {}", e.what()); + LOG_WARNING(Config, "Failed to transfer install directories: {}", e.what()); } // Transfer addon install directory @@ -685,7 +685,7 @@ bool EmulatorSettingsImpl::TransferSettings() { } } } catch (const std::exception& e) { - LOG_DEBUG(Config, "Failed to transfer addon install directory: {}", e.what()); + LOG_WARNING(Config, "Failed to transfer addon install directory: {}", e.what()); } } if (og_data.contains("General")) { @@ -704,7 +704,7 @@ bool EmulatorSettingsImpl::TransferSettings() { } } } catch (const std::exception& e) { - LOG_DEBUG(Config, "Failed to transfer sysmodules install directory: {}", e.what()); + LOG_WARNING(Config, "Failed to transfer sysmodules install directory: {}", e.what()); } // Transfer font install directory @@ -720,7 +720,7 @@ bool EmulatorSettingsImpl::TransferSettings() { } } } catch (const std::exception& e) { - LOG_DEBUG(Config, "Failed to transfer font install directory: {}", e.what()); + LOG_WARNING(Config, "Failed to transfer font install directory: {}", e.what()); } } diff --git a/src/core/emulator_settings.h b/src/core/emulator_settings.h index 274c445dc..8d3125fdb 100644 --- a/src/core/emulator_settings.h +++ b/src/core/emulator_settings.h @@ -127,9 +127,9 @@ inline OverrideItem make_override(const char* key, Setting Struct::* member) } dst.game_specific_value = newValue; } catch (const std::exception& e) { - LOG_DEBUG(Config, "[make_override] error parsing {}: {}", key, e.what()); - LOG_DEBUG(Config, "[make_override] Entry was: {}", entry.dump()); - LOG_DEBUG(Config, "[make_override] Type name: {}", entry.type_name()); + LOG_ERROR(Config, "[make_override] error parsing {}: {}", key, e.what()); + LOG_ERROR(Config, "[make_override] Entry was: {}", entry.dump()); + LOG_ERROR(Config, "[make_override] Type name: {}", entry.type_name()); } }, diff --git a/src/core/user_settings.cpp b/src/core/user_settings.cpp index fdc129a8c..2fa8c42bc 100644 --- a/src/core/user_settings.cpp +++ b/src/core/user_settings.cpp @@ -59,13 +59,13 @@ bool UserSettingsImpl::Save() const { std::ofstream out(path); if (!out) { - LOG_DEBUG(Config, "Failed to open user settings for writing: {}", path.string()); + LOG_ERROR(Config, "Failed to open user settings for writing: {}", path.string()); return false; } out << std::setw(2) << existing; return !out.fail(); } catch (const std::exception& e) { - LOG_DEBUG(Config, "Error saving user settings: {}", e.what()); + LOG_ERROR(Config, "Error saving user settings: {}", e.what()); return false; } } @@ -83,7 +83,7 @@ bool UserSettingsImpl::Load() { std::ifstream in(path); if (!in) { - LOG_DEBUG(Config, "Failed to open user settings: {}", path.string()); + LOG_ERROR(Config, "Failed to open user settings: {}", path.string()); return false; } @@ -108,7 +108,7 @@ bool UserSettingsImpl::Load() { return true; } catch (const std::exception& e) { - LOG_DEBUG(Config, "Error loading user settings: {}", e.what()); + LOG_ERROR(Config, "Error loading user settings: {}", e.what()); if (m_userManager.GetUsers().user.empty()) m_userManager.GetUsers() = m_userManager.CreateDefaultUsers(); return false;