mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-07-10 01:34:42 -06:00
Fix log level (#4577)
* fix shadps4.log level * shadps4 log everything * Fix trace log Unix
This commit is contained in:
parent
f1b457f116
commit
11edaeabb8
@ -184,6 +184,7 @@ void Setup(std::string_view shadps4_filename) {
|
||||
|
||||
for (auto& [name, logger] : ALL_LOGGERS) {
|
||||
logger = std::make_shared<spdlog::logger>(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) {
|
||||
|
||||
@ -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, ...) \
|
||||
|
||||
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -127,9 +127,9 @@ inline OverrideItem make_override(const char* key, Setting<T> 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());
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user