@@ -165,12 +165,7 @@ synchronized void handleUncaughtException(
165
165
@ NonNull final Throwable ex ) {
166
166
167
167
Logger .getLogger ()
168
- .d (
169
- "Crashlytics is handling uncaught "
170
- + "exception \" "
171
- + ex
172
- + "\" from thread "
173
- + thread .getName ());
168
+ .d ("Handling uncaught " + "exception \" " + ex + "\" from thread " + thread .getName ());
174
169
175
170
// Capture the time that the crash occurs and close over it so that the time doesn't
176
171
// reflect when we get around to executing the task later.
@@ -258,7 +253,7 @@ private Task<Boolean> waitForReportAction() {
258
253
}
259
254
260
255
Logger .getLogger ().d ("Automatic data collection is disabled." );
261
- Logger .getLogger ().d ("Notifying that unsent reports are available." );
256
+ Logger .getLogger ().v ("Notifying that unsent reports are available." );
262
257
unsentReportsAvailable .trySetResult (true );
263
258
264
259
// If data collection gets enabled while we are waiting for an action, go ahead and send the
@@ -289,7 +284,7 @@ boolean didCrashOnPreviousExecution() {
289
284
return sessionId != null && nativeComponent .hasCrashDataForSession (sessionId );
290
285
}
291
286
292
- Logger .getLogger ().d ("Found previous crash marker." );
287
+ Logger .getLogger ().v ("Found previous crash marker." );
293
288
crashMarker .remove ();
294
289
295
290
return Boolean .TRUE ;
@@ -302,7 +297,7 @@ Task<Boolean> checkForUnsentReports() {
302
297
// and 2) when there's a fatal crash. So no new reports will become available while the app is
303
298
// running.
304
299
if (!checkForUnsentReportsCalled .compareAndSet (false , true )) {
305
- Logger .getLogger ().d ("checkForUnsentReports should only be called once per execution." );
300
+ Logger .getLogger ().w ("checkForUnsentReports should only be called once per execution." );
306
301
return Tasks .forResult (false );
307
302
}
308
303
return unsentReportsAvailable .getTask ();
@@ -321,11 +316,11 @@ Task<Void> deleteUnsentReports() {
321
316
Task <Void > submitAllReports (Task <AppSettingsData > appSettingsDataTask ) {
322
317
if (!reportingCoordinator .hasReportsToSend ()) {
323
318
// Just notify the user that there are no reports and stop.
324
- Logger .getLogger ().d ("No reports are available." );
319
+ Logger .getLogger ().v ("No crash reports are available to be sent ." );
325
320
unsentReportsAvailable .trySetResult (false );
326
321
return Tasks .forResult (null );
327
322
}
328
- Logger .getLogger ().d ( "Unsent reports are available." );
323
+ Logger .getLogger ().v ( "Crash reports are available to be sent ." );
329
324
330
325
return waitForReportAction ()
331
326
.onSuccessTask (
@@ -339,14 +334,14 @@ public Task<Void> then(@Nullable Boolean send) throws Exception {
339
334
@ Override
340
335
public Task <Void > call () throws Exception {
341
336
if (!send ) {
342
- Logger .getLogger ().d ( "Reports are being deleted ." );
337
+ Logger .getLogger ().v ( "Deleting cached crash reports.. ." );
343
338
deleteFiles (listAppExceptionMarkerFiles ());
344
339
reportingCoordinator .removeAllReports ();
345
340
unsentReportsHandled .trySetResult (null );
346
341
return Tasks .forResult (null );
347
342
}
348
343
349
- Logger .getLogger ().d ("Reports are being sent ." );
344
+ Logger .getLogger ().d ("Sending cached crash reports.. ." );
350
345
351
346
// waitForReportAction guarantees we got user permission.
352
347
boolean dataCollectionToken = send ;
@@ -367,7 +362,7 @@ public Task<Void> then(@Nullable AppSettingsData appSettingsData)
367
362
if (appSettingsData == null ) {
368
363
Logger .getLogger ()
369
364
.w (
370
- "Received null app settings, cannot send reports during app startup." );
365
+ "Received null app settings at app startup. Cannot send cached reports " );
371
366
return Tasks .forResult (null );
372
367
}
373
368
logAnalyticsAppExceptionEvents ();
@@ -414,7 +409,7 @@ public void run() {
414
409
final String currentSessionId = getCurrentSessionId ();
415
410
if (currentSessionId == null ) {
416
411
Logger .getLogger ()
417
- .d ("Tried to write a non-fatal exception while no session was open." );
412
+ .w ("Tried to write a non-fatal exception while no session was open." );
418
413
return ;
419
414
}
420
415
reportingCoordinator .persistNonFatalEvent (
@@ -526,18 +521,18 @@ boolean finalizeSessions() {
526
521
backgroundWorker .checkRunningOnThread ();
527
522
528
523
if (isHandlingException ()) {
529
- Logger .getLogger ().d ("Skipping session finalization because a crash has already occurred." );
524
+ Logger .getLogger ().w ("Skipping session finalization because a crash has already occurred." );
530
525
return Boolean .FALSE ;
531
526
}
532
527
533
- Logger .getLogger ().d ("Finalizing previously open sessions." );
528
+ Logger .getLogger ().v ("Finalizing previously open sessions." );
534
529
try {
535
530
doCloseSessions (true );
536
531
} catch (Exception e ) {
537
532
Logger .getLogger ().e ("Unable to finalize previously open sessions." , e );
538
533
return false ;
539
534
}
540
- Logger .getLogger ().d ("Closed all previously open sessions" );
535
+ Logger .getLogger ().v ("Closed all previously open sessions. " );
541
536
542
537
return true ;
543
538
}
@@ -577,7 +572,7 @@ private void doCloseSessions(boolean skipCurrentSession) {
577
572
List <String > sortedOpenSessions = reportingCoordinator .listSortedOpenSessionIds ();
578
573
579
574
if (sortedOpenSessions .size () <= offset ) {
580
- Logger .getLogger ().d ("No open sessions to be closed." );
575
+ Logger .getLogger ().v ("No open sessions to be closed." );
581
576
return ;
582
577
}
583
578
@@ -588,7 +583,7 @@ private void doCloseSessions(boolean skipCurrentSession) {
588
583
// data when we aren't including current.
589
584
finalizePreviousNativeSession (mostRecentSessionIdToClose );
590
585
if (!nativeComponent .finalizeSession (mostRecentSessionIdToClose )) {
591
- Logger .getLogger ().d ("Could not finalize native session: " + mostRecentSessionIdToClose );
586
+ Logger .getLogger ().w ("Could not finalize native session: " + mostRecentSessionIdToClose );
592
587
}
593
588
}
594
589
@@ -627,7 +622,7 @@ private static File[] ensureFileArrayNotNull(File[] files) {
627
622
// endregion
628
623
629
624
private void finalizePreviousNativeSession (String previousSessionId ) {
630
- Logger .getLogger ().d ("Finalizing native report for session " + previousSessionId );
625
+ Logger .getLogger ().v ("Finalizing native report for session " + previousSessionId );
631
626
NativeSessionFileProvider nativeSessionFileProvider =
632
627
nativeComponent .getSessionFileProvider (previousSessionId );
633
628
File minidumpFile = nativeSessionFileProvider .getMinidumpFile ();
@@ -643,7 +638,7 @@ private void finalizePreviousNativeSession(String previousSessionId) {
643
638
final File nativeSessionDirectory = new File (getNativeSessionFilesDir (), previousSessionId );
644
639
645
640
if (!nativeSessionDirectory .mkdirs ()) {
646
- Logger .getLogger ().d ("Couldn't create native sessions directory " );
641
+ Logger .getLogger ().w ("Couldn't create directory to store native session files, aborting. " );
647
642
return ;
648
643
}
649
644
@@ -673,7 +668,7 @@ private void doWriteAppExceptionMarker(long eventTime) {
673
668
try {
674
669
new File (getFilesDir (), APP_EXCEPTION_MARKER_PREFIX + eventTime ).createNewFile ();
675
670
} catch (IOException e ) {
676
- Logger .getLogger ().d ("Could not write app exception marker." );
671
+ Logger .getLogger ().w ("Could not create app exception marker file." , e );
677
672
}
678
673
}
679
674
@@ -772,7 +767,7 @@ private Task<Void> logAnalyticsAppExceptionEvents() {
772
767
Long .parseLong (markerFile .getName ().substring (APP_EXCEPTION_MARKER_PREFIX .length ()));
773
768
events .add (logAnalyticsAppExceptionEvent (timestamp ));
774
769
} catch (NumberFormatException nfe ) {
775
- Logger .getLogger ().d ("Could not parse timestamp from file " + markerFile .getName ());
770
+ Logger .getLogger ().w ("Could not parse timestamp from file " + markerFile .getName ());
776
771
}
777
772
markerFile .delete ();
778
773
}
@@ -782,9 +777,10 @@ private Task<Void> logAnalyticsAppExceptionEvents() {
782
777
783
778
private Task <Void > logAnalyticsAppExceptionEvent (long timestamp ) {
784
779
if (firebaseCrashExists ()) {
785
- Logger .getLogger ().d ("Skipping logging Crashlytics event to Firebase, FirebaseCrash exists" );
780
+ Logger .getLogger ().v ("Skipping logging Crashlytics event to Firebase, FirebaseCrash exists" );
786
781
return Tasks .forResult (null );
787
782
}
783
+ Logger .getLogger ().d ("Logging app exception event to Firebase Analytics" );
788
784
final ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor (1 );
789
785
return Tasks .call (
790
786
executor ,
0 commit comments