feat: Enhance logging in various controllers and services for better traceability

This commit is contained in:
2026-01-04 14:12:38 +00:00
parent d5d1debd8a
commit d2934ebc8d
5 changed files with 56 additions and 36 deletions

View File

@@ -5,31 +5,33 @@ namespace sdl3cpp::controllers {
LifecycleController::LifecycleController(di::ServiceRegistry& registry)
: registry_(registry) {
logging::TraceGuard trace;
logging::Logger::GetInstance().Trace("LifecycleController::LifecycleController: Created");
}
LifecycleController::~LifecycleController() {
logging::TraceGuard trace;
logging::Logger::GetInstance().Trace("LifecycleController::~LifecycleController: Destroyed");
}
void LifecycleController::InitializeAll() {
logging::TraceGuard trace;
logging::Logger::GetInstance().Info("Initializing all services");
logging::Logger::GetInstance().Trace("LifecycleController::InitializeAll: Entering");
logging::Logger::GetInstance().Info("LifecycleController::InitializeAll: Initializing all services");
// ServiceRegistry handles initialization order based on dependencies
registry_.InitializeAll();
logging::Logger::GetInstance().Info("All services initialized");
logging::Logger::GetInstance().Info("LifecycleController::InitializeAll: All services initialized");
logging::Logger::GetInstance().Trace("LifecycleController::InitializeAll: Exiting");
}
void LifecycleController::ShutdownAll() noexcept {
logging::TraceGuard trace;
logging::Logger::GetInstance().Info("Shutting down all services");
logging::Logger::GetInstance().Trace("LifecycleController::ShutdownAll: Entering");
logging::Logger::GetInstance().Info("LifecycleController::ShutdownAll: Shutting down all services");
// ServiceRegistry handles shutdown in reverse dependency order
registry_.ShutdownAll();
logging::Logger::GetInstance().Info("All services shutdown");
logging::Logger::GetInstance().Info("LifecycleController::ShutdownAll: All services shutdown");
logging::Logger::GetInstance().Trace("LifecycleController::ShutdownAll: Exiting");
}
} // namespace sdl3cpp::controllers