Skip to content

Conversation

@ueman
Copy link
Collaborator

@ueman ueman commented Jul 2, 2021

📜 Description

This disables print() breadcrumbs on Flutter

💡 Motivation and Context

#492

💚 How did you test it?

New test

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2021

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.67%. Comparing base (679dce9) to head (c717a19).
⚠️ Report is 1742 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #515   +/-   ##
=======================================
  Coverage   91.67%   91.67%           
=======================================
  Files          70       70           
  Lines        2318     2319    +1     
=======================================
+ Hits         2125     2126    +1     
  Misses        193      193           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

SentryFlutterOptions({String? dsn, PlatformChecker? checker})
: super(dsn: dsn, checker: checker) {
enableBreadcrumbTrackingForCurrentPlatform();
enablePrintBreadcrumbs = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that the only option? I'd prefer rather a workaround if possible :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could intercept https://github.com/flutter/flutter/blob/f4abaa0735eba4dfd8f33f73363911d63931fe03/packages/flutter/lib/src/foundation/assertions.dart#L919

and disable recording when it's called.
Kinda like what we do it for FlutterError.onError.
Does that sound better?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds better to me, rather than disabling the feature by default.
we can check if its the FlutterExceptionHandler type and do not log it if its a release build, because, on debug level, printing to console is rather useful

@ueman
Copy link
Collaborator Author

ueman commented Oct 12, 2021

Closed in favor of #618

@ueman ueman closed this Oct 12, 2021
@marandaneto marandaneto deleted the ref/disable-print-breadcrumbs branch December 10, 2021 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants