From 411f5ab235dbc43a031dd8daddf07c2e26399eaf Mon Sep 17 00:00:00 2001 From: Sentry Github Bot Date: Tue, 25 Oct 2022 23:10:12 +0000 Subject: [PATCH] Format code --- Sources/Sentry/SentryProfiler.mm | 3 ++- Sources/Sentry/SentrySpan.m | 3 ++- Sources/Sentry/SentryTracer.m | 18 ++++++++++++------ Sources/Sentry/SentryUIEventTracker.m | 14 ++++++++++---- .../SentryUIViewControllerPerformanceTracker.m | 7 ++++--- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/Sources/Sentry/SentryProfiler.mm b/Sources/Sentry/SentryProfiler.mm index 7b799c80fd8..644bdccf60f 100644 --- a/Sources/Sentry/SentryProfiler.mm +++ b/Sources/Sentry/SentryProfiler.mm @@ -244,7 +244,8 @@ + (void)captureEnvelopeIfFinished:(SentryProfiler *)profiler spanID:(SentrySpanI [profiler captureEnvelope]; [profiler->_transactions removeAllObjects]; } else { - SENTRY_LOG_DEBUG(@"Profiler %@ is waiting for more spans to complete: %@.", profiler, profiler->_spansInFlight); + SENTRY_LOG_DEBUG(@"Profiler %@ is waiting for more spans to complete: %@.", profiler, + profiler->_spansInFlight); } } diff --git a/Sources/Sentry/SentrySpan.m b/Sources/Sentry/SentrySpan.m index ddc9cf4d7b1..3949032bfdd 100644 --- a/Sources/Sentry/SentrySpan.m +++ b/Sources/Sentry/SentrySpan.m @@ -131,7 +131,8 @@ - (void)finishWithStatus:(SentrySpanStatus)status self.timestamp = [SentryCurrentDate date]; } if (self.tracer == nil) { - SENTRY_LOG_DEBUG(@"No tracer associated with span with id %@", _context.spanId.sentrySpanIdString); + SENTRY_LOG_DEBUG( + @"No tracer associated with span with id %@", _context.spanId.sentrySpanIdString); return; } [self.tracer spanFinished:self]; diff --git a/Sources/Sentry/SentryTracer.m b/Sources/Sentry/SentryTracer.m index de44aef22f3..a04aeb940a5 100644 --- a/Sources/Sentry/SentryTracer.m +++ b/Sources/Sentry/SentryTracer.m @@ -262,7 +262,8 @@ - (void)cancelIdleTimeout context.spanDescription = description; SentrySpan *child = [[SentrySpan alloc] initWithTracer:self context:context]; - SENTRY_LOG_DEBUG(@"Started child span %@ under %@", child.context.spanId.sentrySpanIdString, parentId.sentrySpanIdString); + SENTRY_LOG_DEBUG(@"Started child span %@ under %@", child.context.spanId.sentrySpanIdString, + parentId.sentrySpanIdString); @synchronized(_children) { [_children addObject:child]; } @@ -275,7 +276,8 @@ - (void)spanFinished:(id)finishedSpan // Calling canBeFinished on the rootSpan would end up in an endless loop because canBeFinished // calls finish on the rootSpan. if (finishedSpan == self.rootSpan) { - SENTRY_LOG_DEBUG(@"Cannot call finish on root span with id %@", finishedSpan.context.spanId.sentrySpanIdString); + SENTRY_LOG_DEBUG(@"Cannot call finish on root span with id %@", + finishedSpan.context.spanId.sentrySpanIdString); return; } [self canBeFinished]; @@ -417,20 +419,24 @@ - (void)canBeFinished // Transaction already finished and captured. // Sending another transaction and spans with // the same SentryId would be an error. - if (self.rootSpan.isFinished){ - SENTRY_LOG_DEBUG(@"Root span with id %@ is already finished", self.rootSpan.context.spanId.sentrySpanIdString); + if (self.rootSpan.isFinished) { + SENTRY_LOG_DEBUG(@"Root span with id %@ is already finished", + self.rootSpan.context.spanId.sentrySpanIdString); return; } BOOL hasUnfinishedChildSpansToWaitFor = [self hasUnfinishedChildSpansToWaitFor]; if (!self.wasFinishCalled && !hasUnfinishedChildSpansToWaitFor && [self hasIdleTimeout]) { - SENTRY_LOG_DEBUG(@"Root span with id %@ isn't waiting on children and needs idle timeout dispatched.", self.rootSpan.context.spanId.sentrySpanIdString); + SENTRY_LOG_DEBUG( + @"Root span with id %@ isn't waiting on children and needs idle timeout dispatched.", + self.rootSpan.context.spanId.sentrySpanIdString); [self dispatchIdleTimeout]; return; } if (!self.wasFinishCalled || hasUnfinishedChildSpansToWaitFor) { - SENTRY_LOG_DEBUG(@"Root span with id %@ has children but isn't waiting for them right now.", self.rootSpan.context.spanId.sentrySpanIdString); + SENTRY_LOG_DEBUG(@"Root span with id %@ has children but isn't waiting for them right now.", + self.rootSpan.context.spanId.sentrySpanIdString); return; } diff --git a/Sources/Sentry/SentryUIEventTracker.m b/Sources/Sentry/SentryUIEventTracker.m index ed1cf2ab0a0..93abeac2c57 100644 --- a/Sources/Sentry/SentryUIEventTracker.m +++ b/Sources/Sentry/SentryUIEventTracker.m @@ -53,12 +53,16 @@ - (void)start [self.swizzleWrapper swizzleSendAction:^(NSString *action, id target, id sender, UIEvent *event) { if (target == nil) { - SENTRY_LOG_DEBUG(@"Target was nil for action %@; won't capture in transaction (sender: %@; event: %@)", action, sender, event); + SENTRY_LOG_DEBUG(@"Target was nil for action %@; won't capture in transaction " + @"(sender: %@; event: %@)", + action, sender, event); return; } if (sender == nil) { - SENTRY_LOG_DEBUG(@"Sender was nil for action %@; won't capture in transaction (target: %@; event: %@)", action, sender, event); + SENTRY_LOG_DEBUG(@"Sender was nil for action %@; won't capture in transaction " + @"(target: %@; event: %@)", + action, sender, event); return; } @@ -87,7 +91,8 @@ - (void)start BOOL sameAction = [currentActiveTransaction.transactionContext.name isEqualToString:transactionName]; if (sameAction) { - SENTRY_LOG_DEBUG(@"Dispatching idle timeout for transaction with span id %@", currentActiveTransaction.context.spanId.sentrySpanIdString); + SENTRY_LOG_DEBUG(@"Dispatching idle timeout for transaction with span id %@", + currentActiveTransaction.context.spanId.sentrySpanIdString); [currentActiveTransaction dispatchIdleTimeout]; return; } @@ -95,7 +100,8 @@ - (void)start [currentActiveTransaction finish]; if (currentActiveTransaction) { - SENTRY_LOG_DEBUG(@"SentryUIEventTracker finished transaction %@", currentActiveTransaction.transactionContext.name); + SENTRY_LOG_DEBUG(@"SentryUIEventTracker finished transaction %@", + currentActiveTransaction.transactionContext.name); } NSString *operation = [self getOperation:sender]; diff --git a/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m b/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m index b587d7d4316..3f3fd9640a4 100644 --- a/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m +++ b/Sources/Sentry/SentryUIViewControllerPerformanceTracker.m @@ -58,7 +58,7 @@ - (void)viewControllerLoadView:(UIViewController *)controller target:controller callbackToOrigin:callbackToOrigin block:^{ - SENTRY_LOG_DEBUG(@"Tracking UIViewController.loadView"); + SENTRY_LOG_DEBUG(@"Tracking UIViewController.loadView"); [self createTransaction:controller]; [self measurePerformance:@"loadView" @@ -74,7 +74,7 @@ - (void)viewControllerViewDidLoad:(UIViewController *)controller target:controller callbackToOrigin:callbackToOrigin block:^{ - SENTRY_LOG_DEBUG(@"Tracking UIViewController.viewDidLoad"); + SENTRY_LOG_DEBUG(@"Tracking UIViewController.viewDidLoad"); [self createTransaction:controller]; [self measurePerformance:@"viewDidLoad" @@ -95,7 +95,8 @@ - (void)createTransaction:(UIViewController *)controller spanId = [self.tracker startSpanWithName:name nameSource:kSentryTransactionNameSourceComponent operation:SentrySpanOperationUILoad]; - SENTRY_LOG_DEBUG(@"Started span with id %@ to track view controller.", spanId.sentrySpanIdString); + SENTRY_LOG_DEBUG( + @"Started span with id %@ to track view controller.", spanId.sentrySpanIdString); // Use the target itself to store the spanId to avoid using a global mapper. objc_setAssociatedObject(controller, &SENTRY_UI_PERFORMANCE_TRACKER_SPAN_ID, spanId,