Package io.sentry
Class Breadcrumb
java.lang.Object
io.sentry.Breadcrumb
- All Implemented Interfaces:
JsonSerializable
,JsonUnknown
Series of application events
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
-
Constructor Summary
ConstructorDescriptionBreadcrumb ctorBreadcrumb
(@NotNull Date timestamp) Breadcrumb ctorBreadcrumb
(@Nullable String message) Breadcrumb ctor -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Breadcrumb
Creates debug breadcrumb - typically a log message.static @NotNull Breadcrumb
Creates error breadcrumb.@Nullable String
Returns the categorygetData()
Returns the data map@Nullable Object
Returns the value of data[key] or null@Nullable SentryLevel
getLevel()
Returns the SentryLevel@Nullable String
Returns the message@NotNull Date
Returns the Breadcrumb's timestamp@Nullable String
getType()
Returns the typestatic @NotNull Breadcrumb
Creates HTTP breadcrumb.static @NotNull Breadcrumb
Creates HTTP breadcrumb.static @NotNull Breadcrumb
Creates info breadcrumb - information that helps identify the root cause of the issue or for whom the error occurred.static @NotNull Breadcrumb
navigation
(@NotNull String from, @NotNull String to) Creates navigation breadcrumb - a navigation event can be a URL change in a web application, or a UI transition in a mobile or desktop application, etc.static @NotNull Breadcrumb
Creates query breadcrumb - representing a query that was made in your application.void
removeData
(@NotNull String key) Removes an entry from the data's mapvoid
serialize
(@NotNull JsonObjectWriter writer, @NotNull ILogger logger) void
setCategory
(@Nullable String category) Sets the categoryvoid
Sets an entry to the data's mapvoid
setLevel
(@Nullable SentryLevel level) Sets the levelvoid
setMessage
(@Nullable String message) Sets the messagevoid
Sets the typevoid
setUnknown
(@Nullable Map<String, Object> unknown) static @NotNull Breadcrumb
transaction
(@NotNull String message) Creates transaction breadcrumb - describing a tracing event.static @NotNull Breadcrumb
Creates ui breadcrumb - a user interaction with your app's UI.static @NotNull Breadcrumb
Creates user breadcrumb - a user interaction with your app's UI.static @NotNull Breadcrumb
userInteraction
(@NotNull String subCategory, @Nullable String viewId, @Nullable String viewClass) Creates user breadcrumb - a user interaction with your app's UI.static @NotNull Breadcrumb
userInteraction
(@NotNull String subCategory, @Nullable String viewId, @Nullable String viewClass, @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI.static @NotNull Breadcrumb
userInteraction
(@NotNull String subCategory, @Nullable String viewId, @Nullable String viewClass, @Nullable String viewTag, @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI.
-
Constructor Details
-
Breadcrumb
Breadcrumb ctor- Parameters:
timestamp
- the timestamp
-
Breadcrumb
public Breadcrumb()Breadcrumb ctor -
Breadcrumb
Breadcrumb ctor- Parameters:
message
- the message
-
-
Method Details
-
http
@NotNull public static @NotNull Breadcrumb http(@NotNull @NotNull String url, @NotNull @NotNull String method) Creates HTTP breadcrumb.- Parameters:
url
- - the request URLmethod
- - the request method- Returns:
- the breadcrumb
-
http
@NotNull public static @NotNull Breadcrumb http(@NotNull @NotNull String url, @NotNull @NotNull String method, @Nullable @Nullable Integer code) Creates HTTP breadcrumb.- Parameters:
url
- - the request URLmethod
- - the request methodcode
- - the code result. Code can be null when http request did not finish or ended with network error- Returns:
- the breadcrumb
-
transaction
Creates transaction breadcrumb - describing a tracing event.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
debug
Creates debug breadcrumb - typically a log message. The data part is entirely undefined and as such, completely rendered as a key/value table.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
error
Creates error breadcrumb.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
info
Creates info breadcrumb - information that helps identify the root cause of the issue or for whom the error occurred.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
query
Creates query breadcrumb - representing a query that was made in your application.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
ui
@NotNull public static @NotNull Breadcrumb ui(@NotNull @NotNull String category, @NotNull @NotNull String message) Creates ui breadcrumb - a user interaction with your app's UI.- Parameters:
category
- - the category, for example "click"message
- - the message- Returns:
- the breadcrumb
-
user
@NotNull public static @NotNull Breadcrumb user(@NotNull @NotNull String category, @NotNull @NotNull String message) Creates user breadcrumb - a user interaction with your app's UI.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
userInteraction
@NotNull public static @NotNull Breadcrumb userInteraction(@NotNull @NotNull String subCategory, @Nullable @Nullable String viewId, @Nullable @Nullable String viewClass) Creates user breadcrumb - a user interaction with your app's UI. The breadcrumb can contain additional data likeviewId
orviewClass
. By default, the breadcrumb is captured withSentryLevel
INFO level.- Parameters:
subCategory
- - the category, for example "click"viewId
- - the human-readable view id, for example "button_load"viewClass
- - the fully qualified class name, for example "android.widget.Button"- Returns:
- the breadcrumb
-
userInteraction
@NotNull public static @NotNull Breadcrumb userInteraction(@NotNull @NotNull String subCategory, @Nullable @Nullable String viewId, @Nullable @Nullable String viewClass, @Nullable @Nullable String viewTag, @NotNull @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI. The breadcrumb can contain additional data likeviewId
orviewClass
. By default, the breadcrumb is captured withSentryLevel
INFO level.- Parameters:
subCategory
- - the category, for example "click"viewId
- - the human-readable view id, for example "button_load"viewClass
- - the fully qualified class name, for example "android.widget.Button"viewTag
- - the custom tag of the view, for example "button_launch_rocket"additionalData
- - additional properties to be put into the data bag- Returns:
- the breadcrumb
-
userInteraction
@NotNull public static @NotNull Breadcrumb userInteraction(@NotNull @NotNull String subCategory, @Nullable @Nullable String viewId, @Nullable @Nullable String viewClass, @NotNull @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI. The breadcrumb can contain additional data likeviewId
orviewClass
. By default, the breadcrumb is captured withSentryLevel
INFO level.- Parameters:
subCategory
- - the category, for example "click"viewId
- - the human-readable view id, for example "button_load"viewClass
- - the fully qualified class name, for example "android.widget.Button"additionalData
- - additional properties to be put into the data bag- Returns:
- the breadcrumb
-
getTimestamp
Returns the Breadcrumb's timestamp- Returns:
- the timestamp
-
getMessage
Returns the message- Returns:
- the message
-
setMessage
Sets the message- Parameters:
message
- the message
-
getType
Returns the type- Returns:
- the type
-
setType
Sets the type- Parameters:
type
- the type
-
getData
Returns the data map- Returns:
- the data map
-
getData
Returns the value of data[key] or null- Parameters:
key
- the key- Returns:
- the value or null
-
setData
Sets an entry to the data's map- Parameters:
key
- the keyvalue
- the value
-
removeData
Removes an entry from the data's map- Parameters:
key
- the key
-
getCategory
Returns the category- Returns:
- the category
-
setCategory
Sets the category- Parameters:
category
- the category
-
getLevel
Returns the SentryLevel- Returns:
- the level
-
setLevel
Sets the level- Parameters:
level
- the level
-
getUnknown
- Specified by:
getUnknown
in interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknown
in interfaceJsonUnknown
-
serialize
public void serialize(@NotNull @NotNull JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serialize
in interfaceJsonSerializable
- Throws:
IOException
-