public class Context extends Object implements Serializable
Breadcrumb
s)
so that data may be collected in different parts of an application and
then sent together when an exception occurs.Constructor and Description |
---|
Context()
Create a new (empty) Context object with the default Breadcrumb limit.
|
Context(int breadcrumbLimit)
Create a new (empty) Context object with the specified Breadcrumb limit.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtra(String name,
Object value)
Add extra data to the current context.
|
void |
addTag(String name,
String value)
Add tag to the current context.
|
void |
clear()
Clear state from this context.
|
void |
clearBreadcrumbs()
Clear all breadcrumbs from this context.
|
void |
clearExtra()
Clear all extra data from this context.
|
void |
clearTags()
Clear all tags from the current context.
|
void |
clearUser()
Clears the current user set on this context.
|
List<Breadcrumb> |
getBreadcrumbs()
Return
Breadcrumb s attached to this context. |
Map<String,Object> |
getExtra()
Return extra data attached to this context.
|
UUID |
getLastEventId()
Get the UUID of the last event sent by this thread, useful for handling user feedback.
|
Map<String,String> |
getTags()
Return tags attached to this context.
|
User |
getUser()
Gets the current user from the context.
|
void |
recordBreadcrumb(Breadcrumb breadcrumb)
Record a single
Breadcrumb into this context. |
void |
removeExtra(String name)
Remove an extra data name and value from the current context.
|
void |
removeTag(String name)
Remove a tag name and value from the current context.
|
void |
setLastEventId(UUID id)
Store the UUID of the last sent event by this thread, useful for handling user feedback.
|
void |
setUser(User user)
Store the current user in the context.
|
public Context()
public Context(int breadcrumbLimit)
breadcrumbLimit
- Number of Breadcrumb objects to retain in ring buffer.public void clear()
public List<Breadcrumb> getBreadcrumbs()
Breadcrumb
s attached to this context.Breadcrumb
s.public Map<String,String> getTags()
public Map<String,Object> getExtra()
public void addTag(String name, String value)
name
- tag namevalue
- tag valuepublic void removeTag(String name)
name
- tag name to removepublic void clearTags()
public void addExtra(String name, Object value)
name
- extra namevalue
- extra valuepublic void removeExtra(String name)
name
- extra name to removepublic void clearExtra()
public void recordBreadcrumb(Breadcrumb breadcrumb)
Breadcrumb
into this context.breadcrumb
- Breadcrumb object to recordpublic void clearBreadcrumbs()
public void setLastEventId(UUID id)
id
- UUID of the last event sent by this thread.public UUID getLastEventId()
public void setUser(User user)
user
- User to store in context.public void clearUser()
public User getUser()
Copyright © 2012–2018. All rights reserved.