Skip to content

Commit fb8d9e5

Browse files
woody-applerestyled-commitsbzbarsky-apple
authored
Consolidating logs on Darwin (#33553)
* Updating logs * Restyled by clang-format * Updating logs * Updating logs * Restyled by clang-format * Updating logs names * Restyled by clang-format * Update src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.mm Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Update src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.mm Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Made errors * Adding log for pool size * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent bbb4196 commit fb8d9e5

17 files changed

+123
-119
lines changed

src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm

+9-9
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ - (void)callReadyHandlerWithContext:(id)context completion:(MTRAsyncWorkCompleti
126126
auto readyHandler = _readyHandler;
127127
dispatch_async(_queue, ^{
128128
if (!retryCount) {
129-
MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> executing work item [%llu]", context, uniqueID);
129+
MTR_LOG("MTRAsyncWorkQueue<%@> executing work item [%llu]", context, uniqueID);
130130
} else {
131-
MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> executing work item [%llu] (retry %zd)", context, uniqueID, retryCount);
131+
MTR_LOG("MTRAsyncWorkQueue<%@> executing work item [%llu] (retry %zd)", context, uniqueID, retryCount);
132132
}
133133
if (readyHandler) {
134134
readyHandler(context, retryCount, completion);
@@ -268,9 +268,9 @@ - (void)enqueueWorkItem:(MTRAsyncWorkItem *)item
268268
// Logging the description once is enough because other log messages
269269
// related to the work item (execution, completion etc) can easily be
270270
// correlated using the unique id.
271-
MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@, items count: %tu> enqueued work item [%llu]: %@", context.description, _items.count, item.uniqueID, description);
271+
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %tu> enqueued work item [%llu]: %@", context.description, _items.count, item.uniqueID, description);
272272
} else {
273-
MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@, items count: %tu> enqueued work item [%llu]", context.description, _items.count, item.uniqueID);
273+
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %tu> enqueued work item [%llu]", context.description, _items.count, item.uniqueID);
274274
}
275275

276276
[self _callNextReadyWorkItemWithContext:context];
@@ -280,7 +280,7 @@ - (void)invalidate
280280
{
281281
ContextSnapshot context(self); // outside of lock
282282
std::lock_guard lock(_lock);
283-
MTR_LOG_INFO("MTRAsyncWorkQueue<%@> invalidate %tu items", context.description, _items.count);
283+
MTR_LOG("MTRAsyncWorkQueue<%@> invalidate %tu items", context.description, _items.count);
284284
for (MTRAsyncWorkItem * item in _items) {
285285
[item cancel];
286286
}
@@ -309,14 +309,14 @@ - (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem
309309

310310
// already part of the running work items allowed by width - retry directly
311311
if (retry) {
312-
MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> retry needed for work item [%llu]", context.description, workItem.uniqueID);
312+
MTR_LOG("MTRAsyncWorkQueue<%@> retry needed for work item [%llu]", context.description, workItem.uniqueID);
313313
[self _callWorkItem:workItem withContext:context];
314314
return;
315315
}
316316

317317
[workItem markComplete];
318318
[_items removeObjectAtIndex:indexOfWorkItem];
319-
MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@, items count: %tu> completed work item [%llu]", context.description, _items.count, workItem.uniqueID);
319+
MTR_LOG("MTRAsyncWorkQueue<%@, items count: %tu> completed work item [%llu]", context.description, _items.count, workItem.uniqueID);
320320

321321
// sanity check running work item count is positive
322322
if (_runningWorkItemCount == 0) {
@@ -398,11 +398,11 @@ - (void)_callNextReadyWorkItemWithContext:(ContextSnapshot const &)context
398398
case MTRNotBatched:
399399
goto done; // can't merge anything else
400400
case MTRBatchedPartially:
401-
MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> partially merged work item [%llu] into %llu",
401+
MTR_LOG("MTRAsyncWorkQueue<%@> partially merged work item [%llu] into %llu",
402402
context.description, nextWorkItem.uniqueID, workItem.uniqueID);
403403
goto done; // can't merge anything else
404404
case MTRBatchedFully:
405-
MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> fully merged work item [%llu] into %llu",
405+
MTR_LOG("MTRAsyncWorkQueue<%@> fully merged work item [%llu] into %llu",
406406
context.description, nextWorkItem.uniqueID, workItem.uniqueID);
407407
[_items removeObjectAtIndex:1];
408408
continue; // try to batch the next item (if any)

src/darwin/Framework/CHIP/MTRCertificates.mm

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ + (MTRCertificateDERBytes _Nullable)createRootCertificate:(id<MTRKeypair>)keypai
4242
validityPeriod:(NSDateInterval *)validityPeriod
4343
error:(NSError * __autoreleasing *)error
4444
{
45-
MTR_LOG_DEFAULT("Generating root certificate");
45+
MTR_LOG("Generating root certificate");
4646
NSData * rootCert = nil;
4747
CHIP_ERROR err
4848
= MTROperationalCredentialsDelegate::GenerateRootCertificate(keypair, issuerID, fabricID, validityPeriod, &rootCert);
@@ -74,7 +74,7 @@ + (MTRCertificateDERBytes _Nullable)createIntermediateCertificate:(id<MTRKeypair
7474
validityPeriod:(NSDateInterval *)validityPeriod
7575
error:(NSError * __autoreleasing *)error
7676
{
77-
MTR_LOG_DEFAULT("Generating intermediate certificate");
77+
MTR_LOG("Generating intermediate certificate");
7878
NSData * intermediate = nil;
7979
CHIP_ERROR err = MTROperationalCredentialsDelegate::GenerateIntermediateCertificate(
8080
rootKeypair, rootCertificate, intermediatePublicKey, issuerID, fabricID, validityPeriod, &intermediate);
@@ -115,7 +115,7 @@ + (MTRCertificateDERBytes _Nullable)createOperationalCertificate:(id<MTRKeypair>
115115
validityPeriod:(NSDateInterval *)validityPeriod
116116
error:(NSError * __autoreleasing _Nullable * _Nullable)error
117117
{
118-
MTR_LOG_DEFAULT("Generating operational certificate");
118+
MTR_LOG("Generating operational certificate");
119119
NSData * opcert = nil;
120120
CHIP_ERROR err = MTROperationalCredentialsDelegate::GenerateOperationalCertificate(
121121
signingKeypair, signingCertificate, operationalPublicKey, fabricID, nodeID, caseAuthenticatedTags, validityPeriod, &opcert);

0 commit comments

Comments
 (0)