Package io.sentry
Class Breadcrumb
java.lang.Object
io.sentry.Breadcrumb
- All Implemented Interfaces:
JsonSerializable,JsonUnknown
Series of application events
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionBreadcrumb ctorBreadcrumb(@NotNull Date timestamp) Breadcrumb ctorBreadcrumb(@Nullable String message) Breadcrumb ctor -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BreadcrumbCreates debug breadcrumb - typically a log message.static @NotNull BreadcrumbCreates error breadcrumb.@Nullable StringReturns the categorygetData()Returns the data map@Nullable ObjectReturns the value of data[key] or null@Nullable SentryLevelgetLevel()Returns the SentryLevel@Nullable StringReturns the message@NotNull DateReturns the Breadcrumb's timestamp@Nullable StringgetType()Returns the typestatic @NotNull BreadcrumbCreates HTTP breadcrumb.static @NotNull BreadcrumbCreates HTTP breadcrumb.static @NotNull BreadcrumbCreates info breadcrumb - information that helps identify the root cause of the issue or for whom the error occurred.static @NotNull Breadcrumbnavigation(@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 BreadcrumbCreates query breadcrumb - representing a query that was made in your application.voidremoveData(@NotNull String key) Removes an entry from the data's mapvoidserialize(@NotNull JsonObjectWriter writer, @NotNull ILogger logger) voidsetCategory(@Nullable String category) Sets the categoryvoidSets an entry to the data's mapvoidsetLevel(@Nullable SentryLevel level) Sets the levelvoidsetMessage(@Nullable String message) Sets the messagevoidSets the typevoidsetUnknown(@Nullable Map<String, Object> unknown) static @NotNull Breadcrumbtransaction(@NotNull String message) Creates transaction breadcrumb - describing a tracing event.static @NotNull BreadcrumbCreates ui breadcrumb - a user interaction with your app's UI.static @NotNull BreadcrumbCreates user breadcrumb - a user interaction with your app's UI.static @NotNull BreadcrumbuserInteraction(@NotNull String subCategory, @Nullable String viewId, @Nullable String viewClass) Creates user breadcrumb - a user interaction with your app's UI.static @NotNull BreadcrumbuserInteraction(@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.
-
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 likeviewIdorviewClass. By default, the breadcrumb is captured withSentryLevelINFO 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, @NotNull @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI. The breadcrumb can contain additional data likeviewIdorviewClass. By default, the breadcrumb is captured withSentryLevelINFO 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:
getUnknownin interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknownin interfaceJsonUnknown
-
serialize
public void serialize(@NotNull @NotNull JsonObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serializein interfaceJsonSerializable- Throws:
IOException
-