public final class Sentry
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Sentry.OptionsConfiguration<T extends SentryOptions>
Configuration options callback
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addBreadcrumb(@NotNull Breadcrumb breadcrumb)
Adds a breadcrumb to the current Scope
|
static void |
addBreadcrumb(@NotNull Breadcrumb breadcrumb,
@Nullable java.lang.Object hint)
Adds a breadcrumb to the current Scope
|
static void |
addBreadcrumb(@NotNull java.lang.String message)
Adds a breadcrumb to the current Scope
|
static void |
addBreadcrumb(@NotNull java.lang.String message,
@NotNull java.lang.String category)
Adds a breadcrumb to the current Scope
|
static void |
bindClient(@NotNull ISentryClient client)
Binds a different client to the current hub
|
static @NotNull SentryId |
captureEvent(@NotNull SentryEvent event)
Captures the event.
|
static @NotNull SentryId |
captureEvent(@NotNull SentryEvent event,
@Nullable java.lang.Object hint)
Captures the event.
|
static @NotNull SentryId |
captureException(@NotNull java.lang.Throwable throwable)
Captures the exception.
|
static @NotNull SentryId |
captureException(@NotNull java.lang.Throwable throwable,
@Nullable java.lang.Object hint)
Captures the exception.
|
static @NotNull SentryId |
captureMessage(@NotNull java.lang.String message)
Captures the message.
|
static @NotNull SentryId |
captureMessage(@NotNull java.lang.String message,
@NotNull SentryLevel level)
Captures the message.
|
static void |
clearBreadcrumbs()
Deletes current breadcrumbs from the current scope.
|
static void |
close()
Close the SDK
|
static void |
configureScope(@NotNull ScopeCallback callback)
Configures the scope through the callback.
|
static void |
endSession()
Ends the current session
|
static void |
flush(long timeoutMillis)
Flushes events queued up to the current hub.
|
static @NotNull SentryId |
getLastEventId()
Last event id recorded in the current scope
|
static void |
init()
Initializes the SDK
|
static <T extends SentryOptions> |
init(@NotNull OptionsContainer<T> clazz,
@NotNull Sentry.OptionsConfiguration<T> optionsConfiguration)
Initializes the SDK
|
static <T extends SentryOptions> |
init(@NotNull OptionsContainer<T> clazz,
@NotNull Sentry.OptionsConfiguration<T> optionsConfiguration,
boolean globalHubMode)
Initializes the SDK
|
static void |
init(@NotNull Sentry.OptionsConfiguration<SentryOptions> optionsConfiguration)
Initializes the SDK with an optional configuration options callback.
|
static void |
init(@NotNull Sentry.OptionsConfiguration<SentryOptions> optionsConfiguration,
boolean globalHubMode)
Initializes the SDK with an optional configuration options callback.
|
static boolean |
isEnabled()
Check if the current Hub is enabled/active.
|
static void |
popScope()
Removes the first scope
|
static void |
pushScope()
Pushes a new scope while inheriting the current scope's data.
|
static void |
removeExtra(@NotNull java.lang.String key)
Removes the extra key to an arbitrary value to the current Scope
|
static void |
removeTag(@NotNull java.lang.String key)
Removes the tag to a string value to the current Scope
|
static void |
setExtra(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets the extra key to an arbitrary value to the current Scope, overwriting a potential previous
value
|
static void |
setFingerprint(@NotNull java.util.List<java.lang.String> fingerprint)
Sets the fingerprint to group specific events together to the current Scope.
|
static void |
setLevel(@Nullable SentryLevel level)
Sets the level of all events sent within current Scope
|
static void |
setTag(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets the tag to a string value to the current Scope, overwriting a potential previous value
|
static void |
setTransaction(@Nullable java.lang.String transaction)
Sets the name of the current transaction to the current Scope.
|
static void |
setUser(@Nullable User user)
Shallow merges user configuration (email, username, etc) to the current Scope.
|
static void |
startSession()
Starts a new session.
|
static void |
withScope(@NotNull ScopeCallback callback)
Runs the callback with a new scope which gets dropped at the end
|
public static boolean isEnabled()
public static void init()
public static <T extends SentryOptions> void init(@NotNull @NotNull OptionsContainer<T> clazz, @NotNull @NotNull Sentry.OptionsConfiguration<T> optionsConfiguration) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
T - class that extends SentryOptionsclazz - OptionsContainer for SentryOptionsoptionsConfiguration - configuration options callbackjava.lang.IllegalAccessException - the IllegalAccessExceptionjava.lang.InstantiationException - the InstantiationExceptionjava.lang.NoSuchMethodException - the NoSuchMethodExceptionjava.lang.reflect.InvocationTargetException - the InvocationTargetExceptionpublic static <T extends SentryOptions> void init(@NotNull @NotNull OptionsContainer<T> clazz, @NotNull @NotNull Sentry.OptionsConfiguration<T> optionsConfiguration, boolean globalHubMode) throws java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
T - class that extends SentryOptionsclazz - OptionsContainer for SentryOptionsoptionsConfiguration - configuration options callbackglobalHubMode - the globalHubModejava.lang.IllegalAccessException - the IllegalAccessExceptionjava.lang.InstantiationException - the InstantiationExceptionjava.lang.NoSuchMethodException - the NoSuchMethodExceptionjava.lang.reflect.InvocationTargetException - the InvocationTargetExceptionpublic static void init(@NotNull
@NotNull Sentry.OptionsConfiguration<SentryOptions> optionsConfiguration)
optionsConfiguration - configuration options callbackpublic static void init(@NotNull
@NotNull Sentry.OptionsConfiguration<SentryOptions> optionsConfiguration,
boolean globalHubMode)
optionsConfiguration - configuration options callbackglobalHubMode - the globalHubModepublic static void close()
@NotNull public static @NotNull SentryId captureEvent(@NotNull @NotNull SentryEvent event)
event - the event@NotNull public static @NotNull SentryId captureEvent(@NotNull @NotNull SentryEvent event, @Nullable @Nullable java.lang.Object hint)
event - the eventhint - SDK specific but provides high level information about the origin of the event@NotNull public static @NotNull SentryId captureMessage(@NotNull @NotNull java.lang.String message)
message - The message to send.@NotNull public static @NotNull SentryId captureMessage(@NotNull @NotNull java.lang.String message, @NotNull @NotNull SentryLevel level)
message - The message to send.level - The message level.@NotNull public static @NotNull SentryId captureException(@NotNull @NotNull java.lang.Throwable throwable)
throwable - The exception.@NotNull public static @NotNull SentryId captureException(@NotNull @NotNull java.lang.Throwable throwable, @Nullable @Nullable java.lang.Object hint)
throwable - The exception.hint - SDK specific but provides high level information about the origin of the eventpublic static void addBreadcrumb(@NotNull
@NotNull Breadcrumb breadcrumb,
@Nullable
@Nullable java.lang.Object hint)
breadcrumb - the breadcrumbhint - SDK specific but provides high level information about the origin of the eventpublic static void addBreadcrumb(@NotNull
@NotNull Breadcrumb breadcrumb)
breadcrumb - the breadcrumbpublic static void addBreadcrumb(@NotNull
@NotNull java.lang.String message)
message - rendered as text and the whitespace is preserved.public static void addBreadcrumb(@NotNull
@NotNull java.lang.String message,
@NotNull
@NotNull java.lang.String category)
message - rendered as text and the whitespace is preserved.category - Categories are dotted strings that indicate what the crumb is or where it comes
from.public static void setLevel(@Nullable
@Nullable SentryLevel level)
level - the Sentry levelpublic static void setTransaction(@Nullable
@Nullable java.lang.String transaction)
transaction - the transactionpublic static void setUser(@Nullable
@Nullable User user)
user - the userpublic static void setFingerprint(@NotNull
@NotNull java.util.List<java.lang.String> fingerprint)
fingerprint - the fingerprintspublic static void clearBreadcrumbs()
public static void setTag(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
key - the keyvalue - the valuepublic static void removeTag(@NotNull
@NotNull java.lang.String key)
key - the keypublic static void setExtra(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
key - the keyvalue - the valuepublic static void removeExtra(@NotNull
@NotNull java.lang.String key)
key - the key@NotNull public static @NotNull SentryId getLastEventId()
public static void pushScope()
public static void popScope()
public static void withScope(@NotNull
@NotNull ScopeCallback callback)
callback - the callbackpublic static void configureScope(@NotNull
@NotNull ScopeCallback callback)
callback - The configure scope callback.public static void bindClient(@NotNull
@NotNull ISentryClient client)
client - the client.public static void flush(long timeoutMillis)
timeoutMillis - time in millisecondspublic static void startSession()
public static void endSession()