Skip to content

Commit 334b1d9

Browse files
Improve logging in setPersistedClusterData. (#36581)
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.
1 parent 90f96ca commit 334b1d9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/darwin/Framework/CHIP/MTRDevice_Concrete.mm

+7
Original file line numberDiff line numberDiff line change
@@ -3799,7 +3799,14 @@ - (NSUInteger)unitTestAttributeCount
37993799

38003800
- (void)setPersistedClusterData:(NSDictionary<MTRClusterPath *, MTRDeviceClusterData *> *)clusterData
38013801
{
3802+
[self _doSetPersistedClusterData:clusterData];
3803+
3804+
// Log after we do the state update, so the log includes the data we just set.
38023805
MTR_LOG("%@ setPersistedClusterData count: %lu", self, static_cast<unsigned long>(clusterData.count));
3806+
}
3807+
3808+
- (void)_doSetPersistedClusterData:(NSDictionary<MTRClusterPath *, MTRDeviceClusterData *> *)clusterData
3809+
{
38033810
if (!clusterData.count) {
38043811
return;
38053812
}

0 commit comments

Comments
 (0)