Configuration

open class Configuration : CallbackAware, MetadataAware, UserAware, FeatureFlagAware

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

Constructors

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

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 addOnSend(@NonNull onSend: OnSendCallback)
Add a callback which will be invoked prior to an event being delivered to 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 addPlugin(@NonNull plugin: Plugin)
Adds a plugin which will be loaded when the bugsnag notifier is instantiated.
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
Retrieves the API key used for events sent to Bugsnag.
Link copied to clipboard
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.
Link copied to clipboard
Set the application version sent to Bugsnag.
Link copied to clipboard
If you want to disable automatic detection of all errors, you can set this property to false.
Link copied to clipboard
Sets whether or not Bugsnag should automatically capture and report User sessions whenever the app enters the foreground.
Link copied to clipboard
Bugsnag uses the concept of "contexts" to help display and group your errors.
Link copied to clipboard
The Delivery implementation used to make network calls to the Bugsnag Error Reporting and Sessions API.
Link copied to clipboard
Allows you to specify the fully-qualified name of error classes that will be discarded before being sent to Bugsnag if they are detected.
Link copied to clipboard
By default we will automatically add breadcrumbs for common application events such as activity lifecycle events and system intents.
Link copied to clipboard
Bugsnag will automatically detect different types of error in your application.
Link copied to clipboard
By default, Bugsnag will be notified of events that happen in any releaseStage.
Link copied to clipboard
Set the endpoints to send data to.
Link copied to clipboard
Set whether or not Bugsnag should generate an anonymous ID and persist it in local storage If disabled, any device ID that has been persisted will not be retrieved, and no new device ID will be generated or stored
Link copied to clipboard
Sets the threshold in milliseconds for an uncaught error to be considered as a crash on launch.
Link copied to clipboard
By default, the notifier's log messages will be logged using android.util.Log with a "Bugsnag" tag unless the releaseStage is "production".
Link copied to clipboard
Sets the maximum number of breadcrumbs which will be stored.
Link copied to clipboard
Sets the maximum number of persisted events which will be stored.
Link copied to clipboard
Sets the maximum number of persisted sessions which will be stored.
Link copied to clipboard
Gets the maximum number of threads that will be reported with an event.
Link copied to clipboard
Gets the maximum string length in any metadata field.
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
Sets the directory where event and session JSON payloads should be persisted if a network request is not successful.
Link copied to clipboard
Set whether or not Bugsnag should persist user information between application sessions.
Link copied to clipboard
Sets which package names Bugsnag should consider as a part of the running application.
Link copied to clipboard
Sets which values should be removed from any Metadata objects before sending them to Bugsnag.
Link copied to clipboard
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.
Link copied to clipboard
Sets whether or not Bugsnag should send crashes synchronously that occurred during the application's launch period.
Link copied to clipboard
Controls whether we should capture and serialize the state of all threads at the time of an error.
Link copied to clipboard
Link copied to clipboard
Gets the maximum time for collecting threads and traces.
Link copied to clipboard
open fun getUser(): User
Returns the currently set User information.
Link copied to clipboard
We'll automatically pull your versionCode from the versionCode field in your AndroidManifest.xml file.
Link copied to clipboard
Whether Bugsnag should try to send crashing errors prior to app termination.
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.
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
open fun removeOnSend(@NonNull onSend: OnSendCallback)
Remove a callback previously added with addOnSend
Link copied to clipboard
Removes a previously added "on session" callback
Link copied to clipboard
open fun setApiKey(@NonNull apiKey: String)
Changes the API key used for events sent to Bugsnag.
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.
Link copied to clipboard
open fun setAppVersion(@Nullable appVersion: String)
Set the application version sent to Bugsnag.
Link copied to clipboard
open fun setAttemptDeliveryOnCrash(attemptDeliveryOnCrash: Boolean)
Whether Bugsnag should try to send crashing errors prior to app termination.
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.
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.
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 setDelivery(@NonNull delivery: Delivery)
The Delivery implementation used to make network calls to the Bugsnag Error Reporting and Sessions API.
Link copied to clipboard
open fun setDiscardClasses(@NonNull discardClasses: Set<Pattern>)
Allows you to specify the fully-qualified name of error classes that will be discarded before being sent to Bugsnag if they are detected.
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.
Link copied to clipboard
open fun setEnabledErrorTypes(@NonNull enabledErrorTypes: ErrorTypes)
Bugsnag will automatically detect different types of error in your application.
Link copied to clipboard
open fun setEnabledReleaseStages(@Nullable enabledReleaseStages: Set<String>)
By default, Bugsnag will be notified of events that happen in any releaseStage.
Link copied to clipboard
Set the endpoints to send data to.
Link copied to clipboard
open fun setGenerateAnonymousId(generateAnonymousId: Boolean)
Set whether or not Bugsnag should generate an anonymous ID and persist it in local storage If disabled, any device ID that has been persisted will not be retrieved, and no new device ID will be generated or stored
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.
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".
Link copied to clipboard
open fun setMaxBreadcrumbs(maxBreadcrumbs: Int)
Sets the maximum number of breadcrumbs which will be stored.
Link copied to clipboard
open fun setMaxPersistedEvents(maxPersistedEvents: Int)
Sets the maximum number of persisted events which will be stored.
Link copied to clipboard
open fun setMaxPersistedSessions(maxPersistedSessions: Int)
Sets the maximum number of persisted sessions which will be stored.
Link copied to clipboard
open fun setMaxReportedThreads(maxReportedThreads: Int)
Sets the maximum number of threads that will be reported with an event.
Link copied to clipboard
open fun setMaxStringValueLength(maxStringValueLength: Int)
Sets the maximum string length in any metadata field.
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.
Link copied to clipboard
open fun setPersistUser(persistUser: Boolean)
Set whether or not Bugsnag should persist user information between application sessions.
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.
Link copied to clipboard
open fun setRedactedKeys(@NonNull redactedKeys: Set<Pattern>)
Sets which values should be removed from any Metadata objects before sending them to Bugsnag.
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.
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.
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.
Link copied to clipboard
open fun setTelemetry(@NonNull telemetry: Set<Telemetry>)
Set which telemetry will be sent to Bugsnag.
Link copied to clipboard
open fun setThreadCollectionTimeLimitMillis(threadCollectionTimeLimitMillis: Long)
Sets the maximum time for collecting threads and traces.
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 setVersionCode(@Nullable versionCode: Integer)
We'll automatically pull your versionCode from the versionCode field in your AndroidManifest.xml file.