diff --git a/packages/firebase_crashlytics/CHANGELOG.md b/packages/firebase_crashlytics/CHANGELOG.md index 00477511694e..17bf38da9b6f 100644 --- a/packages/firebase_crashlytics/CHANGELOG.md +++ b/packages/firebase_crashlytics/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.1.1+2 + +* When reporting to Crashlytics on iOS, and printing supplied logs, do not + prepend each line with "FirebaseCrashlyticsPlugin.m line 44". +* Prepend `firebase_crashlytics: ` to the final answer from Crashlytics + plugin in the log to realize where it's coming from. + ## 0.1.1+1 * Updated README instructions for contributing for consistency with other Flutterfire plugins. diff --git a/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m b/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m index 01f233cbd347..889b879745c7 100644 --- a/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m +++ b/packages/firebase_crashlytics/ios/Classes/FirebaseCrashlyticsPlugin.m @@ -42,7 +42,12 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result // Add logs. NSArray *logs = call.arguments[@"logs"]; for (NSString *log in logs) { - CLS_LOG(@"%@", log); + // Here and below, use CLSLog instead of CLS_LOG to try and avoid + // automatic inclusion of the current code location. It also ensures that + // the log is only written to Crashlytics and not also to the offline log + // as explained here: + // https://support.crashlytics.com/knowledgebase/articles/92519-how-do-i-use-logging + CLSLog(@"%@", log); } // Set keys. @@ -64,14 +69,10 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result } // Add additional information from the Flutter framework to the exception reported in - // Crashlytics. Using CLSLog instead of CLS_LOG to try to avoid the automatic inclusion of the - // line number. It also ensures that the log is only written to Crashlytics and not also to the - // offline log as explained here: - // https://support.crashlytics.com/knowledgebase/articles/92519-how-do-i-use-logging - // Although, that would only happen in debug mode, which this method call is never called in. + // Crashlytics. NSString *information = call.arguments[@"information"]; if ([information length] != 0) { - CLSLog(information); + CLSLog(@"%@", information); } // Report crash. diff --git a/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart b/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart index 355d187807f1..daad45cb7de2 100644 --- a/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart +++ b/packages/firebase_crashlytics/lib/src/firebase_crashlytics.dart @@ -264,7 +264,7 @@ class Crashlytics { }); // Print result. - print(result); + print('firebase_crashlytics: $result'); } } } diff --git a/packages/firebase_crashlytics/pubspec.yaml b/packages/firebase_crashlytics/pubspec.yaml index 05894f9f3fd2..826dcad698af 100644 --- a/packages/firebase_crashlytics/pubspec.yaml +++ b/packages/firebase_crashlytics/pubspec.yaml @@ -2,7 +2,7 @@ name: firebase_crashlytics description: Flutter plugin for Firebase Crashlytics. It reports uncaught errors to the Firebase console. -version: 0.1.1+1 +version: 0.1.1+2 author: Flutter Team homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_crashlytics