Skip to content

Commit 7611b99

Browse files
Adding logging to MTRDeviceController (project-chip#34320)
* Adding logging * Fixing string format * Restyled by clang-format * Ugh. * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 702bae1 commit 7611b99

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/darwin/Framework/CHIP/MTRDeviceController.mm

+5-1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ - (void)shutdown
295295
return;
296296
}
297297

298+
MTR_LOG("Shutting down MTRDeviceController: %@", self);
298299
[self cleanupAfterStartup];
299300
}
300301

@@ -306,6 +307,7 @@ - (void)cleanupAfterStartup
306307
// do the secure session shutdowns. Since we don't want to hold the lock
307308
// while calling out into arbitrary invalidation code, snapshot the list of
308309
// devices before we start invalidating.
310+
MTR_LOG("cleanupAfterStartup MTRDeviceController: %@", self);
309311
os_unfair_lock_lock(&_deviceMapLock);
310312
NSEnumerator * devices = [_nodeIDToDeviceMap objectEnumerator];
311313
[_nodeIDToDeviceMap removeAllObjects];
@@ -323,6 +325,7 @@ - (void)cleanupAfterStartup
323325
// in a very specific way that only MTRDeviceControllerFactory knows about.
324326
- (void)shutDownCppController
325327
{
328+
MTR_LOG("shutDownCppController MTRDeviceController: %p", self);
326329
assertChipStackLockedByCurrentThread();
327330

328331
// Shut down all our endpoints.
@@ -624,6 +627,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams
624627
});
625628
}];
626629
}
630+
MTR_LOG("MTRDeviceController startup: %@", self);
627631

628632
return YES;
629633
}
@@ -1259,7 +1263,7 @@ - (BOOL)checkIsRunning:(NSError * __autoreleasing *)error
12591263
return YES;
12601264
}
12611265

1262-
MTR_LOG_ERROR("Error: %s", [kErrorNotRunning UTF8String]);
1266+
MTR_LOG_ERROR("MTRDeviceController: %@ Error: %s", self, [kErrorNotRunning UTF8String]);
12631267
if (error) {
12641268
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE];
12651269
}

0 commit comments

Comments
 (0)