diff --git a/SilKit/source/services/orchestration/SystemStateTracker.cpp b/SilKit/source/services/orchestration/SystemStateTracker.cpp index c55b9e49f..e901414c5 100644 --- a/SilKit/source/services/orchestration/SystemStateTracker.cpp +++ b/SilKit/source/services/orchestration/SystemStateTracker.cpp @@ -139,14 +139,14 @@ auto SystemStateTracker::UpdateParticipantStatus(const ParticipantStatus& newPar const auto oldParticipantState{participantStatus.state}; const auto newParticipantState{newParticipantStatus.state}; - - Log::LoggerMessage lm{_logger, Log::Level::Debug}; - lm.SetMessage("Updating participant status"); - lm.SetKeyValue("ParticipantName", participantName); - lm.SetKeyValue("OldParticipantState", fmt::format("{}", oldParticipantState)); - lm.SetKeyValue("NewParticipantState", fmt::format("{}", newParticipantState)); - lm.Dispatch(); - + { + Log::LoggerMessage lm{_logger, Log::Level::Debug}; + lm.SetMessage("Updating participant status"); + lm.SetKeyValue("ParticipantName", participantName); + lm.SetKeyValue("OldParticipantState", fmt::format("{}", oldParticipantState)); + lm.SetKeyValue("NewParticipantState", fmt::format("{}", newParticipantState)); + lm.Dispatch(); + } // Check if transition from the old to the new participant state is valid if (!ValidateParticipantStateUpdate(oldParticipantState, newParticipantState)) {