Configuration

open class Configuration : CallbackAware, MetadataAware, UserAware

User-specified configuration storage object, contains information specified at the client level, api-key and endpoint configuration.

Constructors

Configuration
Link copied to clipboard
open fun Configuration(@NonNull() apiKey: String)
Constructs a new Configuration object with default values.

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.
abstract fun addMetadata(section: Null, value: Null)
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
abstract fun addOnBreadcrumb(onBreadcrumb: Null)
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
abstract fun addOnError(onError: Null)
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
abstract fun addOnSession(onSession: Null)
open fun addOnSession(@NonNull() onSession: OnSessionCallback)
Add an "on session" callback, to execute code before every session captured by Bugsnag.
addPlugin
Link copied to clipboard
open fun addPlugin(@NonNull() plugin: Plugin)
Adds a plugin which will be loaded when the bugsnag notifier is instantiated.
clearMetadata
Link copied to clipboard
open fun clearMetadata(@NonNull() section: String)
Removes all the data from the specified section.
abstract fun clearMetadata(section: Null)
open fun clearMetadata(@NonNull() section: String, @NonNull() key: String)
Removes data with the specified key from the specified section.
getApiKey
Link copied to clipboard
open fun getApiKey(): String
Retrieves the API key used for events sent to Bugsnag.
getAppType
Link copied to clipboard
open fun getAppType(): String
If your app's codebase contains different entry-points/processes, but reports to a single Bugsnag project, you might want to add information denoting the type of process the error came from.
getAppVersion
Link copied to clipboard
open fun getAppVersion(): String
Set the application version sent to Bugsnag.
getAutoDetectErrors
Link copied to clipboard
open fun getAutoDetectErrors(): Boolean
If you want to disable automatic detection of all errors, you can set this property to false.
getAutoTrackSessions
Link copied to clipboard
open fun getAutoTrackSessions(): Boolean
Sets whether or not Bugsnag should automatically capture and report User sessions whenever the app enters the foreground.
getContext
Link copied to clipboard
open fun getContext(): String
Bugsnag uses the concept of "contexts" to help display and group your errors.
getDelivery
Link copied to clipboard
open fun getDelivery(): Delivery
The Delivery implementation used to make network calls to the Bugsnag Error Reporting and Sessions API.
getDiscardClasses
Link copied to clipboard
open fun getDiscardClasses(): Set<String>
Allows you to specify the fully-qualified name of error classes that will be discarded before being sent to Bugsnag if they are detected.
getEnabledBreadcrumbTypes
Link copied to clipboard
open fun getEnabledBreadcrumbTypes(): Set<BreadcrumbType>
By default we will automatically add breadcrumbs for common application events such as activity lifecycle events and system intents.
getEnabledErrorTypes
Link copied to clipboard
open fun getEnabledErrorTypes(): ErrorTypes
Bugsnag will automatically detect different types of error in your application.
getEnabledReleaseStages
Link copied to clipboard
open fun getEnabledReleaseStages(): Set<String>
By default, Bugsnag will be notified of events that happen in any releaseStage.
getEndpoints
Link copied to clipboard
open fun getEndpoints(): EndpointConfiguration
Set the endpoints to send data to.
getLaunchCrashThresholdMs
Link copied to clipboard
open fun getLaunchCrashThresholdMs(): Long
Deprecated.
getLaunchDurationMillis
Link copied to clipboard
open fun getLaunchDurationMillis(): Long
Sets the threshold in milliseconds for an uncaught error to be considered as a crash on launch.
getLogger
Link copied to clipboard
open fun getLogger(): Logger
By default, the notifier's log messages will be logged using android.util.Log with a "Bugsnag" tag unless the releaseStage is "production".
getMaxBreadcrumbs
Link copied to clipboard
open fun getMaxBreadcrumbs(): Int
Sets the maximum number of breadcrumbs which will be stored.
getMaxPersistedEvents
Link copied to clipboard
open fun getMaxPersistedEvents(): Int
Sets the maximum number of persisted events which will be stored.
getMaxPersistedSessions
Link copied to clipboard
open fun getMaxPersistedSessions(): Int
Sets the maximum number of persisted sessions which will be stored.
getMetadata
Link copied to clipboard
open fun getMetadata(@NonNull() section: String): Map<String, Any>
Returns a map of data in the specified section.
abstract fun getMetadata(section: Null): Null
open fun getMetadata(@NonNull() section: String, @NonNull() key: String): Any
Returns the value of the specified key in the specified section.
getPersistenceDirectory
Link copied to clipboard
open fun getPersistenceDirectory(): File
Sets the directory where event and session JSON payloads should be persisted if a network request is not successful.
getPersistUser
Link copied to clipboard
open fun getPersistUser(): Boolean
Set whether or not Bugsnag should persist user information between application sessions.
getProjectPackages
Link copied to clipboard
open fun getProjectPackages(): Set<String>
Sets which package names Bugsnag should consider as a part of the running application.
getRedactedKeys
Link copied to clipboard
open fun getRedactedKeys(): Set<String>
Sets which values should be removed from any Metadata objects before sending them to Bugsnag.
getReleaseStage
Link copied to clipboard
open fun getReleaseStage(): String
If you would like to distinguish between errors that happen in different stages of the application release process (development, production, etc) you can set the releaseStage that is reported to Bugsnag.
getSendLaunchCrashesSynchronously
Link copied to clipboard
open fun getSendLaunchCrashesSynchronously(): Boolean
Sets whether or not Bugsnag should send crashes synchronously that occurred during the application's launch period.
getSendThreads
Link copied to clipboard
open fun getSendThreads(): ThreadSendPolicy
Controls whether we should capture and serialize the state of all threads at the time of an error.
getUser
Link copied to clipboard
open fun getUser(): User
Returns the currently set User information.
getVersionCode
Link copied to clipboard
open fun getVersionCode(): Integer
We'll automatically pull your versionCode from the versionCode field in your AndroidManifest.xml file.
load
Link copied to clipboard
open fun load(@NonNull() context: Context): Configuration
Loads a Configuration object from values supplied as meta-data elements in your AndroidManifest.
removeOnBreadcrumb
Link copied to clipboard
abstract fun removeOnBreadcrumb(onBreadcrumb: Null)
open fun removeOnBreadcrumb(@NonNull() onBreadcrumb: OnBreadcrumbCallback)
Removes a previously added "on breadcrumb" callback
removeOnError
Link copied to clipboard
abstract fun removeOnError(onError: Null)
open fun removeOnError(@NonNull() onError: OnErrorCallback)
Removes a previously added "on error" callback
removeOnSession
Link copied to clipboard
abstract fun removeOnSession(onSession: Null)
open fun removeOnSession(@NonNull() onSession: OnSessionCallback)
Removes a previously added "on session" callback
setApiKey
Link copied to clipboard
open fun setApiKey(@NonNull() apiKey: String)
Changes the API key used for events sent to Bugsnag.
setAppType
Link copied to clipboard
open fun setAppType(@Nullable() appType: String)
If your app's codebase contains different entry-points/processes, but reports to a single Bugsnag project, you might want to add information denoting the type of process the error came from.
setAppVersion
Link copied to clipboard
open fun setAppVersion(@Nullable() appVersion: String)
Set the application version sent to Bugsnag.
setAutoDetectErrors
Link copied to clipboard
open fun setAutoDetectErrors(autoDetectErrors: Boolean)
If you want to disable automatic detection of all errors, you can set this property to false.
setAutoTrackSessions
Link copied to clipboard
open fun setAutoTrackSessions(autoTrackSessions: Boolean)
Sets whether or not Bugsnag should automatically capture and report User sessions whenever the app enters the foreground.
setContext
Link copied to clipboard
open fun setContext(@Nullable() context: String)
Bugsnag uses the concept of "contexts" to help display and group your errors.
setDelivery
Link copied to clipboard
open fun setDelivery(@NonNull() delivery: Delivery)
The Delivery implementation used to make network calls to the Bugsnag Error Reporting and Sessions API.
setDiscardClasses
Link copied to clipboard
open fun setDiscardClasses(@NonNull() discardClasses: Set<String>)
Allows you to specify the fully-qualified name of error classes that will be discarded before being sent to Bugsnag if they are detected.
setEnabledBreadcrumbTypes
Link copied to clipboard
open fun setEnabledBreadcrumbTypes(@Nullable() enabledBreadcrumbTypes: Set<BreadcrumbType>)
By default we will automatically add breadcrumbs for common application events such as activity lifecycle events and system intents.
setEnabledErrorTypes
Link copied to clipboard
open fun setEnabledErrorTypes(@NonNull() enabledErrorTypes: ErrorTypes)
Bugsnag will automatically detect different types of error in your application.
setEnabledReleaseStages
Link copied to clipboard
open fun setEnabledReleaseStages(@Nullable() enabledReleaseStages: Set<String>)
By default, Bugsnag will be notified of events that happen in any releaseStage.
setEndpoints
Link copied to clipboard
open fun setEndpoints(@NonNull() endpoints: EndpointConfiguration)
Set the endpoints to send data to.
setLaunchCrashThresholdMs
Link copied to clipboard
open fun setLaunchCrashThresholdMs(launchCrashThresholdMs: Long)
Deprecated.
setLaunchDurationMillis
Link copied to clipboard
open fun setLaunchDurationMillis(launchDurationMillis: Long)
Sets the threshold in milliseconds for an uncaught error to be considered as a crash on launch.
setLogger
Link copied to clipboard
open fun setLogger(@Nullable() logger: Logger)
By default, the notifier's log messages will be logged using android.util.Log with a "Bugsnag" tag unless the releaseStage is "production".
setMaxBreadcrumbs
Link copied to clipboard
open fun setMaxBreadcrumbs(maxBreadcrumbs: Int)
Sets the maximum number of breadcrumbs which will be stored.
setMaxPersistedEvents
Link copied to clipboard
open fun setMaxPersistedEvents(maxPersistedEvents: Int)
Sets the maximum number of persisted events which will be stored.
setMaxPersistedSessions
Link copied to clipboard
open fun setMaxPersistedSessions(maxPersistedSessions: Int)
Sets the maximum number of persisted sessions which will be stored.
setPersistenceDirectory
Link copied to clipboard
open fun setPersistenceDirectory(@Nullable() directory: File)
Sets the directory where event and session JSON payloads should be persisted if a network request is not successful.
setPersistUser
Link copied to clipboard
open fun setPersistUser(persistUser: Boolean)
Set whether or not Bugsnag should persist user information between application sessions.
setProjectPackages
Link copied to clipboard
open fun setProjectPackages(@NonNull() projectPackages: Set<String>)
Sets which package names Bugsnag should consider as a part of the running application.
setRedactedKeys
Link copied to clipboard
open fun setRedactedKeys(@NonNull() redactedKeys: Set<String>)
Sets which values should be removed from any Metadata objects before sending them to Bugsnag.
setReleaseStage
Link copied to clipboard
open fun setReleaseStage(@Nullable() releaseStage: String)
If you would like to distinguish between errors that happen in different stages of the application release process (development, production, etc) you can set the releaseStage that is reported to Bugsnag.
setSendLaunchCrashesSynchronously
Link copied to clipboard
open fun setSendLaunchCrashesSynchronously(sendLaunchCrashesSynchronously: Boolean)
Sets whether or not Bugsnag should send crashes synchronously that occurred during the application's launch period.
setSendThreads
Link copied to clipboard
open fun setSendThreads(@NonNull() sendThreads: ThreadSendPolicy)
Controls whether we should capture and serialize the state of all threads at the time of an error.
setUser
Link copied to clipboard
open fun setUser(@Nullable() id: String, @Nullable() email: String, @Nullable() name: String)
Sets the user associated with the event.
abstract fun setUser(id: Null, email: Null, name: Null)
setVersionCode
Link copied to clipboard
open fun setVersionCode(@Nullable() versionCode: Integer)
We'll automatically pull your versionCode from the versionCode field in your AndroidManifest.xml file.