public class ComponentsReporter extends Object
android.util.Log
, but allows you to provide your own
functionality. Use it as
ComponentsReporter.emitMessage(level, message);
As a default, it simply calls android.util.Log
(see DefaultComponentsReporter
). You may supply your own with provide(ComponentsReporter.Reporter)
.
Modifier and Type | Class and Description |
---|---|
static class |
ComponentsReporter.LogLevel |
static interface |
ComponentsReporter.Reporter |
Modifier and Type | Method and Description |
---|---|
static void |
emitMessage(ComponentsReporter.LogLevel level,
String categoryKey,
String message)
Emit a message that can be logged or escalated by the logger implementation.
|
static void |
emitMessage(ComponentsReporter.LogLevel level,
String categoryKey,
String message,
int samplingFrequency)
Emit a message that can be logged or escalated by the logger implementation.
|
static void |
provide(ComponentsReporter.Reporter instance) |
public static void provide(ComponentsReporter.Reporter instance)
public static void emitMessage(ComponentsReporter.LogLevel level, String categoryKey, String message)
level
- categoryKey
- Unique key for aggregating all occurrences of given error in error
aggregation systemsmessage
- Message to logpublic static void emitMessage(ComponentsReporter.LogLevel level, String categoryKey, String message, int samplingFrequency)
level
- One of ComponentsReporter.LogLevel.WARNING
, ComponentsReporter.LogLevel.ERROR
, ComponentsReporter.LogLevel.FATAL
.categoryKey
- Unique key for aggregating all occurrences of given error in error
aggregation systemsmessage
- Message to logsamplingFrequency
- sampling frequency to override default one