public class ComponentsReporter
extends java.lang.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(com.facebook.rendercore.ErrorReporterDelegate)
.
Modifier and Type | Class and Description |
---|---|
static class |
ComponentsReporter.LogLevel |
Modifier and Type | Method and Description |
---|---|
static void |
emitMessage(ComponentsReporter.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 |
emitMessage(ComponentsReporter.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 |
emitMessage(ComponentsReporter.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 LogLevel |
map(ComponentsReporter.LogLevel level) |
static void |
provide(ErrorReporterDelegate instance) |
public static void provide(ErrorReporterDelegate instance)
public static void emitMessage(ComponentsReporter.LogLevel level, java.lang.String categoryKey, java.lang.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, java.lang.String categoryKey, java.lang.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 onepublic static void emitMessage(ComponentsReporter.LogLevel level, java.lang.String categoryKey, java.lang.String message, int samplingFrequency, java.util.Map<java.lang.String,java.lang.Object> metadata)
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 onemetadata
- map of metadata associated with the messagepublic static LogLevel map(ComponentsReporter.LogLevel level)