From 2533833bdfa7956d3753c071993c8ab631df3949 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 23 Feb 2022 13:08:34 +0100 Subject: [PATCH] [Logging] Log the error message when the StartUp and ShutDown event are not dispatched in the basic cluster (#15141) --- src/app/clusters/basic/basic.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/clusters/basic/basic.cpp b/src/app/clusters/basic/basic.cpp index 9780bc6d4852af..6454f6a5d05d86 100644 --- a/src/app/clusters/basic/basic.cpp +++ b/src/app/clusters/basic/basic.cpp @@ -344,9 +344,10 @@ class PlatformMgrDelegate : public DeviceLayer::PlatformManagerDelegate Events::StartUp::Type event{ softwareVersion }; EventNumber eventNumber; - if (CHIP_NO_ERROR != LogEvent(event, endpoint, eventNumber, EventOptions::Type::kUrgent)) + CHIP_ERROR err = LogEvent(event, endpoint, eventNumber, EventOptions::Type::kUrgent); + if (CHIP_NO_ERROR != err) { - ChipLogError(Zcl, "PlatformMgrDelegate: Failed to record StartUp event"); + ChipLogError(Zcl, "PlatformMgrDelegate: Failed to record StartUp event: %" CHIP_ERROR_FORMAT, err.Format()); } } } @@ -362,9 +363,10 @@ class PlatformMgrDelegate : public DeviceLayer::PlatformManagerDelegate Events::ShutDown::Type event; EventNumber eventNumber; - if (CHIP_NO_ERROR != LogEvent(event, endpoint, eventNumber, EventOptions::Type::kUrgent)) + CHIP_ERROR err = LogEvent(event, endpoint, eventNumber, EventOptions::Type::kUrgent); + if (CHIP_NO_ERROR != err) { - ChipLogError(Zcl, "PlatformMgrDelegate: Failed to record ShutDown event"); + ChipLogError(Zcl, "PlatformMgrDelegate: Failed to record ShutDown event: %" CHIP_ERROR_FORMAT, err.Format()); } } }