Breadcrumbs
This page documents the Bugsee Android SDK 7.x. For the previous major version, see Adding custom data.
Breadcrumbs are small contextual entries that record the sequence of events leading up to an issue — navigation, taps, lifecycle changes, network requests, and system events. They are aggregated into the report timeline and surface in the Bugsee dashboard. The SDK has four built-in breadcrumb sources (app, UI, network, and system). Breadcrumb capture is off by default: turn it on with the CaptureBreadcrumbs option, which custom breadcrumbs need too. To enable collection, or to scrub or drop entries, see Privacy → Breadcrumbs.
Recording custom breadcrumbs
Bugsee.addBreadcrumb(Breadcrumb) records a breadcrumb you build yourself — a navigation event, a business-domain checkpoint, or a breadcrumb forwarded from a wrapper SDK.
Construct a Breadcrumb via Bugsee.getExchangeFactory() rather than implementing the interface — the factory returns a pooled SDK container ready to populate:
static BugseeExchangeFactory getExchangeFactory(); // never null
static void addBreadcrumb(Breadcrumb breadcrumb); // no-op if null / not launched
getExchangeFactory() always returns the shared factory, but its create* methods may return null before the SDK is launched (or after it is stopped) — always null-check. The Breadcrumb it returns exposes setCategory(String), setMessage(String), setType(String), setLevel(Breadcrumb.Level), and setData(...). Level is one of DEBUG, INFO, WARNING, ERROR, FATAL.
The breadcrumb runs through the filter registered via Bugsee.setBreadcrumbFilter(...) before being recorded.
- Java
- Kotlin
BugseeExchangeFactory factory = Bugsee.getExchangeFactory();
Breadcrumb crumb = factory.createBreadcrumb();
if (crumb != null) {
crumb.setCategory("navigation");
crumb.setMessage("Opened checkout");
crumb.setType("default");
crumb.setLevel(Breadcrumb.Level.INFO);
crumb.setData("cart_size", 3);
Bugsee.addBreadcrumb(crumb);
}
// Or build it fully in one call:
Breadcrumb prebuilt = factory.createBreadcrumb(
System.currentTimeMillis(),
"navigation", // category
"Opened checkout", // message
Breadcrumb.Level.INFO, // level (null for default)
"default", // type
null); // optional data map
Bugsee.addBreadcrumb(prebuilt);
val factory = Bugsee.getExchangeFactory()
factory.createBreadcrumb()?.let { crumb ->
crumb.setCategory("navigation")
crumb.setMessage("Opened checkout")
crumb.setType("default")
crumb.setLevel(Breadcrumb.Level.INFO)
crumb.setData("cart_size", 3)
Bugsee.addBreadcrumb(crumb)
}
getExchangeFactory() also builds NetworkEvent instances for Bugsee.addNetworkEvent(...) — see Network events → Recording custom network events.