-
public interface Breadcrumbs
-
-
Method Summary
Modifier and Type Method Description abstract boolean
enableBreadcrumbs(Context context)
Enable logging of breadcrumbs and submission with crash reports abstract boolean
enableBreadcrumbs(Context context, EnumSet<BacktraceBreadcrumbType> breadcrumbTypesToEnable)
Enable logging of breadcrumbs and submission with crash reports abstract boolean
enableBreadcrumbs(Context context, int maxBreadcrumbLogSizeBytes)
Enable logging of breadcrumbs and submission with crash reports abstract boolean
enableBreadcrumbs(Context context, EnumSet<BacktraceBreadcrumbType> breadcrumbTypesToEnable, int maxBreadcrumbLogSizeBytes)
Enable logging of breadcrumbs and submission with crash reports abstract EnumSet<BacktraceBreadcrumbType>
getEnabledBreadcrumbTypes()
Gets the enabled breadcrumb types abstract boolean
clearBreadcrumbs()
Clear breadcrumb logs abstract boolean
addBreadcrumb(String message)
Add a breadcrumb of type "Manual" and level "Info" with the provided message string abstract boolean
addBreadcrumb(String message, BacktraceBreadcrumbLevel level)
Add a breadcrumb of type "Manual" and the desired level with the provided message string abstract boolean
addBreadcrumb(String message, Map<String, Object> attributes)
Add a breadcrumb of type "Manual" and level "Info" with the provided message string and attributes abstract boolean
addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbLevel level)
Add a breadcrumb of type "Manual" and the desired level with the provided message string and attributes abstract boolean
addBreadcrumb(String message, BacktraceBreadcrumbType type)
Add a breadcrumb of the desired type and level "Info" with the provided message string abstract boolean
addBreadcrumb(String message, BacktraceBreadcrumbType type, BacktraceBreadcrumbLevel level)
Add a breadcrumb of the desired level and type with the provided message string abstract boolean
addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbType type)
Add a breadcrumb of the desired type and level "Info" with the provided message string and attributes abstract boolean
addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbType type, BacktraceBreadcrumbLevel level)
Add a breadcrumb of the desired level and type with the provided message string and attributes abstract void
processReportBreadcrumbs(BacktraceReport report)
Process a Backtrace Report to add breadcrumbs, if breadcrumbs is enabled abstract String
getBreadcrumbLogPath()
Get the location of the breadcrumb log abstract void
setCurrentBreadcrumbId(long breadcrumbId)
NOTE: This should only be used for testing abstract long
getCurrentBreadcrumbId()
Get the current breadcrumb ID (exclusive). abstract boolean
isEnabled()
Determinate if Breadcrumbs are enabled. abstract void
setOnSuccessfulBreadcrumbAddEventListener(OnSuccessfulBreadcrumbAddEventListener eventListener)
Set event executed after adding a breadcrumb to the breadcrumb storage. -
-
Method Detail
-
enableBreadcrumbs
abstract boolean enableBreadcrumbs(Context context)
Enable logging of breadcrumbs and submission with crash reports
- Parameters:
context
- context of current state of the application
-
enableBreadcrumbs
abstract boolean enableBreadcrumbs(Context context, EnumSet<BacktraceBreadcrumbType> breadcrumbTypesToEnable)
Enable logging of breadcrumbs and submission with crash reports
- Parameters:
context
- context of current state of the applicationbreadcrumbTypesToEnable
- a set containing which breadcrumb types to enable
-
enableBreadcrumbs
abstract boolean enableBreadcrumbs(Context context, int maxBreadcrumbLogSizeBytes)
Enable logging of breadcrumbs and submission with crash reports
- Parameters:
context
- context of current state of the applicationmaxBreadcrumbLogSizeBytes
- breadcrumb log size limit in bytes, should be a power of 2
-
enableBreadcrumbs
abstract boolean enableBreadcrumbs(Context context, EnumSet<BacktraceBreadcrumbType> breadcrumbTypesToEnable, int maxBreadcrumbLogSizeBytes)
Enable logging of breadcrumbs and submission with crash reports
- Parameters:
context
- context of current state of the applicationbreadcrumbTypesToEnable
- a set containing which breadcrumb types to enablemaxBreadcrumbLogSizeBytes
- breadcrumb log size limit in bytes, should be a power of 2
-
getEnabledBreadcrumbTypes
abstract EnumSet<BacktraceBreadcrumbType> getEnabledBreadcrumbTypes()
Gets the enabled breadcrumb types
-
clearBreadcrumbs
abstract boolean clearBreadcrumbs()
Clear breadcrumb logs
-
addBreadcrumb
abstract boolean addBreadcrumb(String message)
Add a breadcrumb of type "Manual" and level "Info" with the provided message string
- Parameters:
message
- a message which describes this breadcrumb (1KB max)
-
addBreadcrumb
abstract boolean addBreadcrumb(String message, BacktraceBreadcrumbLevel level)
Add a breadcrumb of type "Manual" and the desired level with the provided message string
- Parameters:
message
- a message which describes this breadcrumb (1KB max)level
- the severity level of this breadcrumb
-
addBreadcrumb
abstract boolean addBreadcrumb(String message, Map<String, Object> attributes)
Add a breadcrumb of type "Manual" and level "Info" with the provided message string and attributes
- Parameters:
message
- a message which describes this breadcrumb (1KB max)attributes
- key-value pairs to provide additional information about this breadcrumb (1KB max, including some overhead per key-value pair)
-
addBreadcrumb
abstract boolean addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbLevel level)
Add a breadcrumb of type "Manual" and the desired level with the provided message string and attributes
- Parameters:
message
- a message which describes this breadcrumb (1KB max)attributes
- key-value pairs to provide additional information about this breadcrumb (1KB max, including some overhead per key-value pair)level
- the severity level of this breadcrumb
-
addBreadcrumb
abstract boolean addBreadcrumb(String message, BacktraceBreadcrumbType type)
Add a breadcrumb of the desired type and level "Info" with the provided message string
- Parameters:
message
- a message which describes this breadcrumb (1KB max)type
- broadly describes the category of this breadcrumb
-
addBreadcrumb
abstract boolean addBreadcrumb(String message, BacktraceBreadcrumbType type, BacktraceBreadcrumbLevel level)
Add a breadcrumb of the desired level and type with the provided message string
- Parameters:
message
- a message which describes this breadcrumb (1KB max)type
- broadly describes the category of this breadcrumblevel
- the severity level of this breadcrumb
-
addBreadcrumb
abstract boolean addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbType type)
Add a breadcrumb of the desired type and level "Info" with the provided message string and attributes
- Parameters:
message
- a message which describes this breadcrumb (1KB max)attributes
- key-value pairs to provide additional information about this breadcrumb (1KB max, including some overhead per key-value pair)type
- broadly describes the category of this breadcrumb
-
addBreadcrumb
abstract boolean addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbType type, BacktraceBreadcrumbLevel level)
Add a breadcrumb of the desired level and type with the provided message string and attributes
- Parameters:
message
- a message which describes this breadcrumb (1KB max)attributes
- key-value pairs to provide additional information about this breadcrumb (1KB max, including some overhead per key-value pair)type
- broadly describes the category of this breadcrumblevel
- the severity level of this breadcrumb
-
processReportBreadcrumbs
abstract void processReportBreadcrumbs(BacktraceReport report)
Process a Backtrace Report to add breadcrumbs, if breadcrumbs is enabled
-
getBreadcrumbLogPath
abstract String getBreadcrumbLogPath()
Get the location of the breadcrumb log
-
setCurrentBreadcrumbId
abstract void setCurrentBreadcrumbId(long breadcrumbId)
NOTE: This should only be used for testing
- Parameters:
breadcrumbId
- Will force set the current breadcrumb ID
-
getCurrentBreadcrumbId
abstract long getCurrentBreadcrumbId()
Get the current breadcrumb ID (exclusive). This is useful when breadcrumbs are queued andposted to an API because in the meantime before the breadcrumbs are finally posted we mightget more breadcrumbs which are not relevant (because they occur after queueing up thebreadcrumb sender). Therefore it is useful to mark the breadcrumb sender with the mostcurrent breadcrumb ID at the time of queuing up the request to post the breadcrumbs.
-
isEnabled
abstract boolean isEnabled()
Determinate if Breadcrumbs are enabled.
-
setOnSuccessfulBreadcrumbAddEventListener
abstract void setOnSuccessfulBreadcrumbAddEventListener(OnSuccessfulBreadcrumbAddEventListener eventListener)
Set event executed after adding a breadcrumb to the breadcrumb storage.
- Parameters:
eventListener
- object with method which will be executed.
-
-
-
-