Interface Logger
A logger which allows a user of this library to tap into the log stream produced by this library.
public interface Logger
Methods
debug
void debug(@NonNull String message, LoggerFields... fields)
Log a debug message.
Parameters
Name | Description |
---|---|
message | A message. |
fields | Optional fields to attach to the log message. |
error
void error(@NonNull String message, @NonNull Throwable exception, LoggerFields... fields)
Log an error message with an exception.
Parameters
Name | Description |
---|---|
message | A message describing when the exception happened. |
exception | The exception. |
fields | Optional fields to attach to the log message. |
error
void error(@NonNull String message, LoggerFields... fields)
Log an error message.
Parameters
Name | Description |
---|---|
message | A message. |
fields | Optional fields to attach to the log message. |
getFallback
@NonNull
Logger getFallback()
A logger that only writes the log on the console.
Returns
The fallback logger.
info
void info(@NonNull String message, LoggerFields... fields)
Log an info message.
Parameters
Name | Description |
---|---|
message | A message. |
fields | Optional fields to attach to the log message. |
publishMetric
void publishMetric(@NonNull Metric metric, double value, LoggerFields... dimensions)
Publish a metric to the backend.
Parameters
Name | Description |
---|---|
metric | The metric to publish. |
value | The value of that metric. |
dimensions | Additional dimensions to specify for that metric. |
warn
void warn(@NonNull String message, LoggerFields... fields)
Log a warning message.
Parameters
Name | Description |
---|---|
message | A message. |
fields | Optional fields to attach to the log message. |