Constructor and Description |
---|
Hub(@NotNull SentryOptions options) |
Modifier and Type | Method and Description |
---|---|
void |
addBreadcrumb(@NotNull Breadcrumb breadcrumb,
@Nullable java.lang.Object hint)
Adds a breadcrumb to the current Scope
|
void |
bindClient(@NotNull ISentryClient client)
Binds a different client to the hub
|
SentryId |
captureEnvelope(@NotNull SentryEnvelope envelope,
@Nullable java.lang.Object hint)
Captures an envelope.
|
@NotNull SentryId |
captureEvent(@NotNull SentryEvent event,
@Nullable java.lang.Object hint)
Captures the event.
|
@NotNull SentryId |
captureException(@NotNull java.lang.Throwable throwable,
@Nullable java.lang.Object hint)
Captures the exception.
|
@NotNull SentryId |
captureMessage(@NotNull java.lang.String message,
@NotNull SentryLevel level)
Captures the message.
|
void |
clearBreadcrumbs()
Deletes current breadcrumbs from the current scope.
|
@NotNull IHub |
clone()
Clones the Hub
|
void |
close()
Flushes out the queue for up to timeout seconds and disable the Hub.
|
void |
configureScope(@NotNull 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.
|
@NotNull 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(@NotNull java.lang.String key)
Removes the extra key to an arbitrary value to the current Scope
|
void |
removeTag(@NotNull java.lang.String key)
Removes the tag to a string value to the current Scope
|
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
|
void |
setFingerprint(@NotNull java.util.List<java.lang.String> fingerprint)
Sets the fingerprint to group specific events together to the current Scope.
|
void |
setLevel(@Nullable SentryLevel level)
Sets the level of all events sent within current Scope
|
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
|
void |
setTransaction(@Nullable java.lang.String transaction)
Sets the name of the current transaction to the current Scope.
|
void |
setUser(@Nullable User user)
Shallow merges user configuration (email, username, etc) to the current Scope.
|
void |
startSession()
Starts a new session.
|
void |
withScope(@NotNull ScopeCallback callback)
Runs the callback with a new scope which gets dropped at the end
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBreadcrumb, addBreadcrumb, addBreadcrumb, captureEnvelope, captureEvent, captureException, captureMessage
public Hub(@NotNull @NotNull SentryOptions options)
public boolean isEnabled()
IHub
@NotNull public @NotNull SentryId captureEvent(@NotNull @NotNull SentryEvent event, @Nullable @Nullable java.lang.Object hint)
IHub
captureEvent
in interface IHub
event
- the eventhint
- SDK specific but provides high level information about the origin of the event@NotNull public @NotNull SentryId captureMessage(@NotNull @NotNull java.lang.String message, @NotNull @NotNull SentryLevel level)
IHub
captureMessage
in interface IHub
message
- The message to send.level
- The message level.@ApiStatus.Internal public SentryId captureEnvelope(@NotNull @NotNull SentryEnvelope envelope, @Nullable @Nullable java.lang.Object hint)
IHub
captureEnvelope
in interface IHub
envelope
- the SentryEnvelope to send.hint
- SDK specific but provides high level information about the origin of the event@NotNull public @NotNull SentryId captureException(@NotNull @NotNull java.lang.Throwable throwable, @Nullable @Nullable java.lang.Object hint)
IHub
captureException
in interface IHub
throwable
- The exception.hint
- SDK specific but provides high level information about the origin of the eventpublic void startSession()
IHub
startSession
in interface IHub
public void endSession()
IHub
endSession
in interface IHub
public void close()
IHub
public void addBreadcrumb(@NotNull @NotNull Breadcrumb breadcrumb, @Nullable @Nullable java.lang.Object hint)
IHub
addBreadcrumb
in interface IHub
breadcrumb
- the breadcrumbhint
- SDK specific but provides high level information about the origin of the eventpublic void setLevel(@Nullable @Nullable SentryLevel level)
IHub
public void setTransaction(@Nullable @Nullable java.lang.String transaction)
IHub
setTransaction
in interface IHub
transaction
- the transactionpublic void setUser(@Nullable @Nullable User user)
IHub
public void setFingerprint(@NotNull @NotNull java.util.List<java.lang.String> fingerprint)
IHub
setFingerprint
in interface IHub
fingerprint
- the fingerprintspublic void clearBreadcrumbs()
IHub
clearBreadcrumbs
in interface IHub
public void setTag(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String value)
IHub
public void removeTag(@NotNull @NotNull java.lang.String key)
IHub
public void setExtra(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String value)
IHub
public void removeExtra(@NotNull @NotNull java.lang.String key)
IHub
removeExtra
in interface IHub
key
- the key@NotNull public @NotNull SentryId getLastEventId()
IHub
getLastEventId
in interface IHub
public void pushScope()
IHub
public void popScope()
IHub
public void withScope(@NotNull @NotNull ScopeCallback callback)
IHub
public void configureScope(@NotNull @NotNull ScopeCallback callback)
IHub
configureScope
in interface IHub
callback
- The configure scope callback.public void bindClient(@NotNull @NotNull ISentryClient client)
IHub
bindClient
in interface IHub
client
- the client.public void flush(long timeoutMillis)
IHub