In order to understand what happened in your application before each crash, it can be helpful to leave short log statements that we call breadcrumbs. A configurable number of breadcrumbs are attached to each error report to help diagnose what events led to the error.
Our Flutter package is currently in the pre-release stage and is not yet intended for production use.
By default, Bugsnag captures breadcrumbs for common actions and device changes, including:
This can be controlled using the Enabled Breadcrumb Types configuration option.
Append manual breadcrumbs with a message via the Bugsnag client:
await bugsnag.leaveBreadcrumb('App loaded');
await bugsnag.leaveBreadcrumb('User clicked a button');
Bugsnag will keep track of the time and order of the breadcrumbs, and show them on your dashboard.
Additional data can be attached to breadcrumbs by providing the additional metadata
argument. Metadata will be presented on the Bugsnag dashboard alongside the breadcrumb name and type:
await bugsnag.leaveBreadcrumb(
'Preference updated',
metadata: const {
'from': 'moka',
'to': 'french press'
},
type: BreadcrumbType.state,
);
Breadcrumb “types” can be used to differentiate different types of events, such as user activity and changes in application state. See the Enabled Breadcrumb Types configuration option for a description of the types available. This type will affect how your breadcrumb is shown on the dashboard but they will not be affected by the Enabled Breadcrumb Types configuration option.