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

Functions

addMetadata
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.
addOnBreadcrumb
Link copied to clipboard
open fun addOnBreadcrumb(@NonNull() onBreadcrumb: OnBreadcrumbCallback)
Add an "on breadcrumb" callback, to execute code before every breadcrumb captured by Bugsnag.
addOnError
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.
addOnSession
Link copied to clipboard
open fun addOnSession(@NonNull() onSession: OnSessionCallback)
Add an "on session" callback, to execute code before every session captured by Bugsnag.
clearMetadata
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.
getBreadcrumbs
Link copied to clipboard
open fun getBreadcrumbs(): List<Breadcrumb>
Returns the current buffer of breadcrumbs that will be sent with captured events.
getContext
Link copied to clipboard
open fun getContext(): String
Bugsnag uses the concept of "contexts" to help display and group your errors.
getLastRunInfo
Link copied to clipboard
open fun getLastRunInfo(): LastRunInfo
Retrieves information about the last launch of the application, if it has been run before.
getMetadata
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.
getUser
Link copied to clipboard
open fun getUser(): User
Returns the currently set User information.
leaveBreadcrumb
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
markLaunchCompleted
Link copied to clipboard
open fun markLaunchCompleted()
Informs Bugsnag that the application has finished launching.
notify
Link copied to clipboard
open fun notify(@NonNull() exception: Throwable)
Notify Bugsnag of a handled exception
open fun notify(@NonNull() exception: Throwable, @Nullable() onError: OnErrorCallback)
Notify Bugsnag of a handled exception
pauseSession
Link copied to clipboard
open fun pauseSession()
Pauses tracking of a session.
removeOnBreadcrumb
Link copied to clipboard
open fun removeOnBreadcrumb(@NonNull() onBreadcrumb: OnBreadcrumbCallback)
Removes a previously added "on breadcrumb" callback
removeOnError
Link copied to clipboard
open fun removeOnError(@NonNull() onError: OnErrorCallback)
Removes a previously added "on error" callback
removeOnSession
Link copied to clipboard
open fun removeOnSession(@NonNull() onSession: OnSessionCallback)
Removes a previously added "on session" callback
resumeSession
Link copied to clipboard
open fun resumeSession(): Boolean
Resumes a session which has previously been paused, or starts a new session if none exists.
setContext
Link copied to clipboard
open fun setContext(@Nullable() context: String)
Bugsnag uses the concept of "contexts" to help display and group your errors.
setUser
Link copied to clipboard
open fun setUser(@Nullable() id: String, @Nullable() email: String, @Nullable() name: String)
Sets the user associated with the event.
start
Link copied to clipboard
open fun start(@NonNull() androidContext: Context): Client
Initialize the static Bugsnag client
open fun start(@NonNull() androidContext: Context, @NonNull() config: Configuration): Client
Initialize the static Bugsnag client
open fun start(@NonNull() androidContext: Context, @NonNull() apiKey: String): Client
Initialize the static Bugsnag client
startSession
Link copied to clipboard
open fun startSession()
Starts tracking a new session.

Properties

client
Link copied to clipboard
open val client: Client