feat: Enhance ServiceBasedApp constructor with detailed logging for initialization steps

This commit is contained in:
2026-01-04 13:47:57 +00:00
parent 59e3b9509e
commit dc0c9bfebe

View File

@@ -23,14 +23,19 @@ namespace sdl3cpp::app {
ServiceBasedApp::ServiceBasedApp(const std::filesystem::path& scriptPath)
: scriptPath_(scriptPath) {
logging::TraceGuard trace("ServiceBasedApp::ServiceBasedApp");
logging::Logger::GetInstance().Info("ServiceBasedApp constructor starting");
try {
logging::Logger::GetInstance().Info("Setting up SDL");
SetupSDL();
logging::Logger::GetInstance().Info("Registering services");
RegisterServices();
logging::Logger::GetInstance().Info("Creating controllers");
lifecycleController_ = std::make_unique<controllers::LifecycleController>(registry_);
applicationController_ = std::make_unique<controllers::ApplicationController>(registry_);
logging::Logger::GetInstance().Info("ServiceBasedApp constructor completed");
} catch (const std::exception& e) {
logging::Logger::GetInstance().Error("Failed to initialize ServiceBasedApp: " + std::string(e.what()));
throw;