Bugsnag

class Bugsnag

Static access to a Bugsnag Client, the easiest way to use Bugsnag in your Android app. For example:

Bugsnag.start(this, "your-api-key"); Bugsnag.notify(new RuntimeException("something broke!"));

See also

Properties

Link copied to clipboard
@get:NonNull
open val client: Client

Functions

Link copied to clipboard
open fun addFeatureFlag(@NonNull name: String)
Add a single feature flag with no variant.
open fun addFeatureFlag(@NonNull name: String, @Nullable variant: String)
Add a single feature flag with an optional variant.
Link copied to clipboard
open fun addFeatureFlags(@NonNull featureFlags: Iterable<FeatureFlag>)
Add a collection of feature flags.
Link copied to clipboard
open fun addMetadata(@NonNull section: String, @NonNull value: Map<String, out Any>)
Adds a map of multiple metadata key-value pairs to the specified section.
open fun addMetadata(@NonNull section: String, @NonNull key: String, @Nullable value: Any)
Adds the specified key and value in the specified section.
Link copied to clipboard
open fun addOnBreadcrumb(@NonNull onBreadcrumb: OnBreadcrumbCallback)
Add an "on breadcrumb" callback, to execute code before every breadcrumb captured by Bugsnag.
Link copied to clipboard
open fun addOnError(@NonNull onError: OnErrorCallback)
Add a "on error" callback, to execute code at the point where an error report is captured in Bugsnag.
Link copied to clipboard
open fun addOnSession(@NonNull onSession: OnSessionCallback)
Add an "on session" callback, to execute code before every session captured by Bugsnag.
Link copied to clipboard
open fun clearFeatureFlag(@NonNull name: String)
Remove a single feature flag regardless of its current status.
Link copied to clipboard
Clear all of the feature flags.
Link copied to clipboard
open fun clearMetadata(@NonNull section: String)
Removes all the data from the specified section.
open fun clearMetadata(@NonNull section: String, @NonNull key: String)
Removes data with the specified key from the specified section.
Link copied to clipboard
Returns the current buffer of breadcrumbs that will be sent with captured events.
Link copied to clipboard
Bugsnag uses the concept of "contexts" to help display and group your errors.
Link copied to clipboard
Retrieves information about the last launch of the application, if it has been run before.
Link copied to clipboard
open fun getMetadata(@NonNull section: String): Map<String, Any>
Returns a map of data in the specified section.
open fun getMetadata(@NonNull section: String, @NonNull key: String): Any
Returns the value of the specified key in the specified section.
Link copied to clipboard
open fun getUser(): User
Returns the currently set User information.
Link copied to clipboard
open fun isStarted(): Boolean
Returns true if one of the start methods have been has been called and so Bugsnag is initialized; false if start has not been called and the other methods will throw IllegalStateException.
Link copied to clipboard
open fun leaveBreadcrumb(@NonNull message: String)
Leave a "breadcrumb" log message, representing an action that occurred in your app, to aid with debugging.
open fun leaveBreadcrumb(@NonNull message: String, @NonNull metadata: Map<String, Any>, @NonNull type: BreadcrumbType)
Leave a "breadcrumb" log message representing an action or event which occurred in your app, to aid with debugging
Link copied to clipboard
Informs Bugsnag that the application has finished launching.
Link copied to clipboard
open fun notify(@NonNull exception: Throwable)
open fun notify(@NonNull exception: Throwable, @Nullable onError: OnErrorCallback)
Notify Bugsnag of a handled exception
Link copied to clipboard
open fun pauseSession()
Pauses tracking of a session.
Link copied to clipboard
Removes a previously added "on breadcrumb" callback
Link copied to clipboard
Removes a previously added "on error" callback
Link copied to clipboard
Removes a previously added "on session" callback
Link copied to clipboard
Resumes a session which has previously been paused, or starts a new session if none exists.
Link copied to clipboard
open fun setContext(@Nullable context: String)
Bugsnag uses the concept of "contexts" to help display and group your errors.
Link copied to clipboard
open fun setUser(@Nullable id: String, @Nullable email: String, @Nullable name: String)
Sets the user associated with the event.
Link copied to clipboard
open fun start(@NonNull androidContext: Context): Client
open fun start(@NonNull androidContext: Context, @NonNull config: Configuration): Client
open fun start(@NonNull androidContext: Context, @NonNull apiKey: String): Client
Initialize the static Bugsnag client
Link copied to clipboard
open fun startSession()
Starts tracking a new session.