Skip to content

Instantly share code, notes, and snippets.

@ivansnag
Last active March 9, 2023 22:51
Show Gist options
  • Save ivansnag/327cf37864109fa5d4f5910e43dc223a to your computer and use it in GitHub Desktop.
Save ivansnag/327cf37864109fa5d4f5910e43dc223a to your computer and use it in GitHub Desktop.
val config = Configuration.load(this)
config.addOnError(OnErrorCallback { event ->
for (breadcrumb in event.breadcrumbs.asReversed()) {
val myBreadcrumbMessage = "Navigated to" // insert string message to compare to
if (breadcrumb.message.contains(myBreadcrumbMessage)) {
val value = breadcrumb.message.substringAfter(":").substring(1)
event.addMetadata("Breadcrumb Metadata", "Navigated To", value); //adding to custom metadata
break
}
}
true
})
Bugsnag.start(this, config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment