From 1ca07330f8a39b727c322ee1b351d1dd99bb4fed Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 14 Feb 2022 13:17:43 +0100 Subject: [PATCH] [Logging] Log the error message when the StartUp and ShutDown event are not dispatched in the basic cluster --- 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()); } } }