From 3b612dc32b77c3a0e61e508d948f05bb86f33989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Ueko=CC=88tter?= Date: Fri, 2 Jul 2021 19:02:57 +0200 Subject: [PATCH 1/2] Disable print breadcrumbs on Flutter --- CHANGELOG.md | 2 ++ flutter/lib/src/sentry_flutter_options.dart | 1 + flutter/test/sentry_flutter_options_test.dart | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70fc7d470c..1d293b2840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +* Ref: Disable `print()` breadcrumbs by default on Flutter + # 6.0.0-beta.1 * Feat: Browser detection (#502) diff --git a/flutter/lib/src/sentry_flutter_options.dart b/flutter/lib/src/sentry_flutter_options.dart index 3002bcde19..36008a1a6e 100644 --- a/flutter/lib/src/sentry_flutter_options.dart +++ b/flutter/lib/src/sentry_flutter_options.dart @@ -9,6 +9,7 @@ class SentryFlutterOptions extends SentryOptions { SentryFlutterOptions({String? dsn, PlatformChecker? checker}) : super(dsn: dsn, checker: checker) { enableBreadcrumbTrackingForCurrentPlatform(); + enablePrintBreadcrumbs = false; } /// Enable or disable the Auto session tracking on the Native SDKs (Android/iOS) diff --git a/flutter/test/sentry_flutter_options_test.dart b/flutter/test/sentry_flutter_options_test.dart index a6d871318b..6401a8e6b4 100644 --- a/flutter/test/sentry_flutter_options_test.dart +++ b/flutter/test/sentry_flutter_options_test.dart @@ -55,5 +55,12 @@ void main() { expect(options.enableMemoryPressureBreadcrumbs, isTrue); expect(options.enableAutoNativeBreadcrumbs, isFalse); }); + + testWidgets('enablePrintBreadcrumbs is disabled on Flutter by default', + (WidgetTester tester) async { + final options = SentryFlutterOptions(); + + expect(options.enablePrintBreadcrumbs, isFalse); + }); }); } From c717a1952f78ef2edbe9f854a847dfde0b6d5c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Ueko=CC=88tter?= Date: Fri, 2 Jul 2021 20:32:17 +0200 Subject: [PATCH 2/2] docs --- dart/lib/src/sentry_options.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dart/lib/src/sentry_options.dart b/dart/lib/src/sentry_options.dart index e3f48b7344..897cb70ce1 100644 --- a/dart/lib/src/sentry_options.dart +++ b/dart/lib/src/sentry_options.dart @@ -174,6 +174,9 @@ class SentryOptions { /// Enable this option if you want to record calls to `print()` as /// breadcrumbs. + /// Enabling this on Flutter can result in excessive breadcrumbs as + /// [FlutterError.reportError](https://api.flutter.dev/flutter/foundation/FlutterError/reportError.html) + /// prints to console via `print()`. bool enablePrintBreadcrumbs = true; /// If [platformChecker] is provided, it is used get the envirnoment.