Skip to content

Commit 7a0679d

Browse files
Update log messages with proper log levels. (#8177)
* Update log levels. * Update CHANGELOG.md * Fix style. * Address comments.
1 parent 1d9bb05 commit 7a0679d

File tree

6 files changed

+27
-24
lines changed

6 files changed

+27
-24
lines changed

FirebasePerformance/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Version 8.2.0
2+
* Update log messages with proper log levels.
3+
14
# Version 8.1.0
25
* Firebase Performance logs now contain URLs to see the performance data on the Firebase console.
36

FirebasePerformance/Sources/FPRClient.m

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,21 @@ - (void)logTrace:(FIRTrace *)trace {
179179

180180
// Log the trace metric with its console URL.
181181
if ([trace.name hasPrefix:kFPRPrefixForScreenTraceName]) {
182-
FPRLogDebug(kFPRClientMetricLogged,
183-
@"Logging trace metric - %@ %.4fms. In a minute, visit the Firebase console to "
184-
@"view your data: %@",
185-
metric.traceMetric.name, metric.traceMetric.durationUs / 1000.0,
186-
[FPRConsoleURLGenerator generateScreenTraceURLWithProjectID:self.projectID
187-
bundleID:self.bundleID
188-
traceName:trace.name]);
182+
FPRLogInfo(kFPRClientMetricLogged,
183+
@"Logging trace metric - %@ %.4fms. In a minute, visit the Firebase console to "
184+
@"view your data: %@",
185+
metric.traceMetric.name, metric.traceMetric.durationUs / 1000.0,
186+
[FPRConsoleURLGenerator generateScreenTraceURLWithProjectID:self.projectID
187+
bundleID:self.bundleID
188+
traceName:trace.name]);
189189
} else {
190-
FPRLogDebug(kFPRClientMetricLogged,
191-
@"Logging trace metric - %@ %.4fms. In a minute, visit the Firebase console to "
192-
@"view your data: %@",
193-
metric.traceMetric.name, metric.traceMetric.durationUs / 1000.0,
194-
[FPRConsoleURLGenerator generateCustomTraceURLWithProjectID:self.projectID
195-
bundleID:self.bundleID
196-
traceName:trace.name]);
190+
FPRLogInfo(kFPRClientMetricLogged,
191+
@"Logging trace metric - %@ %.4fms. In a minute, visit the Firebase console to "
192+
@"view your data: %@",
193+
metric.traceMetric.name, metric.traceMetric.durationUs / 1000.0,
194+
[FPRConsoleURLGenerator generateCustomTraceURLWithProjectID:self.projectID
195+
bundleID:self.bundleID
196+
traceName:trace.name]);
197197
}
198198
[self processAndLogEvent:metric];
199199
});
@@ -218,9 +218,9 @@ - (void)logNetworkTrace:(nonnull FPRNetworkTrace *)trace {
218218
NSString *responseCode = networkRequestMetric.hasHTTPResponseCode
219219
? [@(networkRequestMetric.HTTPResponseCode) stringValue]
220220
: @"UNKNOWN";
221-
FPRLogDebug(kFPRClientMetricLogged,
222-
@"Logging network request trace - %@, Response code: %@, %.4fms",
223-
networkRequestMetric.URL, responseCode, duration / 1000.0);
221+
FPRLogInfo(kFPRClientMetricLogged,
222+
@"Logging network request trace - %@, Response code: %@, %.4fms",
223+
networkRequestMetric.URL, responseCode, duration / 1000.0);
224224
FPRMSGPerfMetric *metric = FPRGetPerfMetricMessage(self.config.appID);
225225
metric.networkRequestMetric = networkRequestMetric;
226226
metric.applicationInfo.applicationProcessState =

FirebasePerformance/Sources/Gauges/FPRGaugeManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ - (void)prepareAndDispatchCollectedGaugeDataWithSessionId:(nullable NSString *)s
182182
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
183183
if (dispatchGauges.count > 0 && sessionId != nil) {
184184
[[FPRClient sharedInstance] logGaugeMetric:dispatchGauges forSessionId:sessionId];
185-
FPRLogDebug(kFPRGaugeManagerDataCollected, @"Logging %lu gauge metrics.",
186-
(unsigned long)dispatchGauges.count);
185+
FPRLogInfo(kFPRGaugeManagerDataCollected, @"Logging %lu gauge metrics.",
186+
(unsigned long)dispatchGauges.count);
187187
}
188188
});
189189
});

FirebasePerformance/Sources/Instrumentation/FPRNetworkTrace.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ - (nullable instancetype)initWithURLRequest:(NSURLRequest *)URLRequest {
9191

9292
NSString *trimmedURLString = [FPRNetworkTrace stringByTrimmingURLString:URLRequest];
9393
if (!trimmedURLString || trimmedURLString.length <= 0) {
94-
FPRLogInfo(kFPRNetworkTraceURLLengthExceeds, @"URL length outside limits, returning nil.");
94+
FPRLogWarning(kFPRNetworkTraceURLLengthExceeds, @"URL length outside limits, returning nil.");
9595
return nil;
9696
}
9797

FirebasePerformance/Sources/Instrumentation/Network/Delegates/FPRNSURLSessionDelegate.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ - (void)URLSession:(NSURLSession *)session
2727
[trace didCompleteRequestWithResponse:task.response error:error];
2828
[FPRNetworkTrace removeNetworkTraceFromObject:task];
2929
} @catch (NSException *exception) {
30-
FPRLogInfo(kFPRNetworkTraceNotTrackable, @"Unable to track network request.");
30+
FPRLogWarning(kFPRNetworkTraceNotTrackable, @"Unable to track network request.");
3131
}
3232
}
3333

@@ -47,7 +47,7 @@ - (void)URLSession:(NSURLSession *)session
4747
}
4848
}
4949
} @catch (NSException *exception) {
50-
FPRLogInfo(kFPRNetworkTraceNotTrackable, @"Unable to track network request.");
50+
FPRLogWarning(kFPRNetworkTraceNotTrackable, @"Unable to track network request.");
5151
}
5252
}
5353

FirebasePerformance/Sources/Instrumentation/Network/Delegates/FPRNSURLSessionDelegateInstrument.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void InstrumentURLSessionTaskDidCompleteWithError(FPRClassInstrumentor *instrume
5353
[trace didCompleteRequestWithResponse:task.response error:error];
5454
[FPRNetworkTrace removeNetworkTraceFromObject:task];
5555
} @catch (NSException *exception) {
56-
FPRLogInfo(kFPRNetworkTraceNotTrackable, @"Unable to track network request.");
56+
FPRLogWarning(kFPRNetworkTraceNotTrackable, @"Unable to track network request.");
5757
} @finally {
5858
typedef void (*OriginalImp)(id, SEL, NSURLSession *, NSURLSessionTask *, NSError *);
5959
((OriginalImp)currentIMP)(object, selector, session, task, error);
@@ -90,7 +90,7 @@ void InstrumentURLSessionTaskDidSendBodyDataTotalBytesSentTotalBytesExpectedToSe
9090
}
9191
}
9292
} @catch (NSException *exception) {
93-
FPRLogInfo(kFPRNetworkTraceNotTrackable, @"Unable to track network request.");
93+
FPRLogWarning(kFPRNetworkTraceNotTrackable, @"Unable to track network request.");
9494
} @finally {
9595
typedef void (*OriginalImp)(id, SEL, NSURLSession *, NSURLSessionTask *, int64_t,
9696
int64_t, int64_t);

0 commit comments

Comments
 (0)