From 10664089521fc044de2e5c98538676e4c092c170 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Oct 2024 16:50:55 -0400 Subject: [PATCH] When logging work items in MTRDevice_Concrete, include names, not just ids. (#35920) Makes it easier to tell what commands are being sent, and what attributes are being written. --- src/darwin/Framework/CHIP/MTRDevice_Concrete.mm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 5d6e47c8d9d781..125ced558eb961 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -2845,7 +2845,10 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) } }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"read %@ 0x%llx 0x%llx", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"read %@ 0x%llx (%@) 0x%llx (%@)", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + attributeID.unsignedLongLongValue, MTRAttributeNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(attributeID.unsignedLongLongValue))]; } else { [self _readThroughSkipped]; } @@ -2975,7 +2978,11 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID completion(MTRAsyncWorkComplete); }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ 0x%llx 0x%llx: %@", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue, value]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ 0x%llx (%@) 0x%llx (%@): %@", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + attributeID.unsignedLongLongValue, MTRAttributeNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(attributeID.unsignedLongLongValue)), + value]; } - (NSArray *> *)readAttributePaths:(NSArray *)attributePaths @@ -3122,7 +3129,11 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID workDone(values, error); }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ 0x%llx 0x%llx: %@", endpointID, clusterID.unsignedLongLongValue, commandID.unsignedLongLongValue, commandFields]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ 0x%llx (%@) 0x%llx (%@): %@", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + commandID.unsignedLongLongValue, MTRRequestCommandNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(commandID.unsignedLongLongValue)), + commandFields]; } - (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode