Skip to content

Commit

Permalink
[Logging] Log the error message when the StartUp and ShutDown event a…
Browse files Browse the repository at this point in the history
…re not dispatched in the basic cluster (#15141)
  • Loading branch information
vivien-apple authored and pull[bot] committed Oct 18, 2023
1 parent 08d86e1 commit 2533833
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/clusters/basic/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
Expand All @@ -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());
}
}
}
Expand Down

0 comments on commit 2533833

Please sign in to comment.