Skip to content

Commit

Permalink
Improve logging in setPersistedClusterData. (#36581)
Browse files Browse the repository at this point in the history
Before this change we would log setPersistedClusterData claiming we don't know
our VID/PID/etc, though chances are the data being passed in exactly contains
that information.

In the new setup, we update our state, then log.
  • Loading branch information
bzbarsky-apple authored Nov 21, 2024
1 parent 90f96ca commit 334b1d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/darwin/Framework/CHIP/MTRDevice_Concrete.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3799,7 +3799,14 @@ - (NSUInteger)unitTestAttributeCount

- (void)setPersistedClusterData:(NSDictionary<MTRClusterPath *, MTRDeviceClusterData *> *)clusterData
{
[self _doSetPersistedClusterData:clusterData];

// Log after we do the state update, so the log includes the data we just set.
MTR_LOG("%@ setPersistedClusterData count: %lu", self, static_cast<unsigned long>(clusterData.count));
}

- (void)_doSetPersistedClusterData:(NSDictionary<MTRClusterPath *, MTRDeviceClusterData *> *)clusterData
{
if (!clusterData.count) {
return;
}
Expand Down

0 comments on commit 334b1d9

Please sign in to comment.