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
  • Loading branch information
vivien-apple committed Feb 23, 2022
1 parent 9fa5641 commit 42b71ff
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 42b71ff

Please sign in to comment.