Skip to main content
Version: SDK 5.0.x

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

NameDescription
messageA message.
fieldsOptional 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

NameDescription
messageA message describing when the exception happened.
exceptionThe exception.
fieldsOptional fields to attach to the log message.

error

void error(@NonNull String message, LoggerFields... fields)

Log an error message.

Parameters

NameDescription
messageA message.
fieldsOptional 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

NameDescription
messageA message.
fieldsOptional fields to attach to the log message.

publishMetric

void publishMetric(@NonNull Metric metric, double value, LoggerFields... dimensions)

Publish a metric to the backend.

Parameters

NameDescription
metricThe metric to publish.
valueThe value of that metric.
dimensionsAdditional dimensions to specify for that metric.

warn

void warn(@NonNull String message, LoggerFields... fields)

Log a warning message.

Parameters

NameDescription
messageA message.
fieldsOptional fields to attach to the log message.