feat: Enhance logging system with platform-specific error handling and trace functionality

- Added platform detection and user configuration directory retrieval in platform.cpp and platform.hpp.
- Implemented detailed error reporting for Windows in platform.cpp.
- Updated logger to use std::source_location for improved trace logging in logger.hpp.
- Refactored existing trace guards in various application files to remove function name parameters, utilizing the new logger functionality.
- Introduced a new script (add_traces.sh) to automate the addition of logging includes in relevant source files.
- Enhanced audio_player.cpp and other script files to include detailed logging for function entries and variable states.
This commit is contained in:
2026-01-04 01:38:31 +00:00
parent 198179bfca
commit d8d1c0a557
24 changed files with 211 additions and 103 deletions

View File

@@ -25,7 +25,7 @@ ScriptEngine::ScriptEngine(const std::filesystem::path& scriptPath, bool debugEn
shaderManager_(std::make_unique<ShaderManager>(L_)),
guiManager_(std::make_unique<GuiManager>(L_)),
audioManager_(std::make_unique<AudioManager>(scriptDirectory_)) {
sdl3cpp::logging::TraceGuard trace(__PRETTY_FUNCTION__);;
sdl3cpp::logging::TraceGuard trace;;
if (!L_) {
sdl3cpp::logging::Logger::GetInstance().Error("Failed to create Lua state");
throw std::runtime_error("Failed to create Lua state");