public class ErrorReporter
extends java.lang.Object
android.util.Log
, but allows you to provide your own
functionality. Use it as
ErrorReporter.emitMessage(level, message);
As a default, it simply calls android.util.Log
(see DefaultErrorReporter
). You may supply your own with provide(ErrorReporterDelegate)
.
Modifier and Type | Method and Description |
---|---|
static ErrorReporterDelegate |
getInstance() |
static void |
provide(ErrorReporterDelegate instance) |
static void |
report(LogLevel level,
java.lang.String categoryKey,
java.lang.String message)
Emit a message that can be logged or escalated by the logger implementation.
|
static void |
report(LogLevel level,
java.lang.String categoryKey,
java.lang.String message,
int samplingFrequency)
Emit a message that can be logged or escalated by the logger implementation.
|
static void |
report(LogLevel level,
java.lang.String categoryKey,
java.lang.String message,
int samplingFrequency,
java.util.Map<java.lang.String,java.lang.Object> metadata)
Emit a message that can be logged or escalated by the logger implementation.
|
static void |
report(LogLevel level,
java.lang.String categoryKey,
java.lang.String message,
java.lang.Throwable cause)
Emit a message that can be logged or escalated by the logger implementation.
|
static void |
report(LogLevel level,
java.lang.String categoryKey,
java.lang.String message,
java.lang.Throwable cause,
int samplingFrequency)
Emit a message that can be logged or escalated by the logger implementation.
|
static void |
report(LogLevel level,
java.lang.String categoryKey,
java.lang.String message,
java.lang.Throwable cause,
int samplingFrequency,
java.util.Map<java.lang.String,java.lang.Object> metadata)
Emit a message that can be logged or escalated by the logger implementation.
|
public static void provide(ErrorReporterDelegate instance)
public static void report(LogLevel level, java.lang.String categoryKey, java.lang.String message)
level
- The log level.categoryKey
- Unique key for aggregation.message
- Message to log.public static void report(LogLevel level, java.lang.String categoryKey, java.lang.String message, java.lang.Throwable cause)
level
- The log level.categoryKey
- Unique key for aggregation.message
- Message to log.cause
- Cause to log.public static void report(LogLevel level, java.lang.String categoryKey, java.lang.String message, int samplingFrequency)
level
- The log level.categoryKey
- Unique key for aggregation.message
- Message to log.samplingFrequency
- Sampling frequency to override default one.public static void report(LogLevel level, java.lang.String categoryKey, java.lang.String message, java.lang.Throwable cause, int samplingFrequency)
level
- The log level.categoryKey
- Unique key for aggregation.message
- Message to log.cause
- Cause to log.samplingFrequency
- Sampling frequency to override default one.public static void report(LogLevel level, java.lang.String categoryKey, java.lang.String message, int samplingFrequency, java.util.Map<java.lang.String,java.lang.Object> metadata)
level
- The log level.categoryKey
- Unique key for aggregation.message
- Message to logsamplingFrequency
- sampling frequency to override default onemetadata
- map of metadata associated with the messagepublic static void report(LogLevel level, java.lang.String categoryKey, java.lang.String message, java.lang.Throwable cause, int samplingFrequency, java.util.Map<java.lang.String,java.lang.Object> metadata)
level
- The log level.categoryKey
- Unique key for aggregation.message
- Message to log. * @param cause Cause to log.cause
- Cause to log.samplingFrequency
- sampling frequency to override default one.metadata
- map of metadata associated with the message.public static ErrorReporterDelegate getInstance()