public interface IHub
Modifier and Type | Method and Description |
---|---|
default void |
addBreadcrumb(Breadcrumb breadcrumb)
Adds a breadcrumb to the current Scope
|
void |
addBreadcrumb(Breadcrumb breadcrumb,
@Nullable java.lang.Object hint)
Adds a breadcrumb to the current Scope
|
default void |
addBreadcrumb(@NotNull java.lang.String message)
Adds a breadcrumb to the current Scope
|
default void |
addBreadcrumb(@NotNull java.lang.String message,
@NotNull java.lang.String category)
Adds a breadcrumb to the current Scope
|
void |
bindClient(ISentryClient client)
Binds a different client to the hub
|
default SentryId |
captureEnvelope(SentryEnvelope envelope)
Captures an envelope.
|
SentryId |
captureEnvelope(SentryEnvelope envelope,
@Nullable java.lang.Object hint)
Captures an envelope.
|
default SentryId |
captureEvent(SentryEvent event)
Captures the event.
|
SentryId |
captureEvent(SentryEvent event,
@Nullable java.lang.Object hint)
Captures the event.
|
default SentryId |
captureException(java.lang.Throwable throwable)
Captures the exception.
|
SentryId |
captureException(java.lang.Throwable throwable,
@Nullable java.lang.Object hint)
Captures the exception.
|
default SentryId |
captureMessage(java.lang.String message)
Captures the message.
|
SentryId |
captureMessage(java.lang.String message,
SentryLevel level)
Captures the message.
|
void |
clearBreadcrumbs()
Deletes current breadcrumbs from the current scope.
|
IHub |
clone()
Clones the Hub
|
void |
close()
Flushes out the queue for up to timeout seconds and disable the Hub.
|
void |
configureScope(ScopeCallback callback)
Configures the scope through the callback.
|
void |
endSession()
Ends the current session
|
void |
flush(long timeoutMillis)
Flushes events queued up, but keeps the Hub enabled.
|
SentryId |
getLastEventId()
Last event id recorded in the current scope
|
boolean |
isEnabled()
Check if the Hub is enabled/active.
|
void |
popScope()
Removes the first scope
|
void |
pushScope()
Pushes a new scope while inheriting the current scope's data.
|
void |
removeExtra(java.lang.String key)
Removes the extra key to an arbitrary value to the current Scope
|
void |
removeTag(java.lang.String key)
Removes the tag to a string value to the current Scope
|
void |
setExtra(java.lang.String key,
java.lang.String value)
Sets the extra key to an arbitrary value to the current Scope, overwriting a potential previous
value
|
void |
setFingerprint(java.util.List<java.lang.String> fingerprint)
Sets the fingerprint to group specific events together to the current Scope.
|
void |
setLevel(SentryLevel level)
Sets the level of all events sent within current Scope
|
void |
setTag(java.lang.String key,
java.lang.String value)
Sets the tag to a string value to the current Scope, overwriting a potential previous value
|
void |
setTransaction(java.lang.String transaction)
Sets the name of the current transaction to the current Scope.
|
void |
setUser(User user)
Shallow merges user configuration (email, username, etc) to the current Scope.
|
void |
startSession()
Starts a new session.
|
void |
withScope(ScopeCallback callback)
Runs the callback with a new scope which gets dropped at the end
|
boolean isEnabled()
SentryId captureEvent(SentryEvent event, @Nullable @Nullable java.lang.Object hint)
event
- the eventhint
- SDK specific but provides high level information about the origin of the eventdefault SentryId captureEvent(SentryEvent event)
event
- the eventdefault SentryId captureMessage(java.lang.String message)
message
- The message to send.SentryId captureMessage(java.lang.String message, SentryLevel level)
message
- The message to send.level
- The message level.SentryId captureEnvelope(SentryEnvelope envelope, @Nullable @Nullable java.lang.Object hint)
envelope
- the SentryEnvelope to send.hint
- SDK specific but provides high level information about the origin of the eventdefault SentryId captureEnvelope(SentryEnvelope envelope)
envelope
- the SentryEnvelope to send.SentryId captureException(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 eventdefault SentryId captureException(java.lang.Throwable throwable)
throwable
- The exception.void startSession()
void endSession()
void close()
void addBreadcrumb(Breadcrumb breadcrumb, @Nullable @Nullable java.lang.Object hint)
breadcrumb
- the breadcrumbhint
- SDK specific but provides high level information about the origin of the eventdefault void addBreadcrumb(Breadcrumb breadcrumb)
breadcrumb
- the breadcrumbdefault void addBreadcrumb(@NotNull @NotNull java.lang.String message)
message
- rendered as text and the whitespace is preserved.default 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.void setLevel(SentryLevel level)
level
- the Sentry levelvoid setTransaction(java.lang.String transaction)
transaction
- the transactionvoid setUser(User user)
user
- the uservoid setFingerprint(java.util.List<java.lang.String> fingerprint)
fingerprint
- the fingerprintsvoid clearBreadcrumbs()
void setTag(java.lang.String key, java.lang.String value)
key
- the keyvalue
- the valuevoid removeTag(java.lang.String key)
key
- the keyvoid setExtra(java.lang.String key, java.lang.String value)
key
- the keyvalue
- the valuevoid removeExtra(java.lang.String key)
key
- the keySentryId getLastEventId()
void pushScope()
void popScope()
void withScope(ScopeCallback callback)
callback
- the callbackvoid configureScope(ScopeCallback callback)
callback
- The configure scope callback.void bindClient(ISentryClient client)
client
- the client.void flush(long timeoutMillis)
timeoutMillis
- time in millisecondsIHub clone()