-
public interface InternalLoggerA Logger used to log messages from the internal implementation of the Datadog SDKs.
Rule of thumb to decide which level and target we're using for the Internal Logger usage:
Target.USER: the message needs to either be actionable or provide information about the main steps in data processing (tracking, storage, upload).
Target.TELEMETRY: any event that need to be tracked for usage monitoring or for error diagnostic.
Target.MAINTAINER: can be anything relevant about the moving parts of the core SDK or any of the feature. Level is left to the discretion of the authors of a log.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumInternalLogger.LevelThe severity level of a logged message.
public enumInternalLogger.TargetThe target handler for a log message.
public classInternalLogger.Companion
-
Method Summary
Modifier and Type Method Description abstract Unitlog(InternalLogger.Level level, InternalLogger.Target target, Function0<String> messageBuilder, Throwable throwable, Boolean onlyOnce, Map<String, Object> additionalProperties)Logs a message from the internal implementation. abstract Unitlog(InternalLogger.Level level, List<InternalLogger.Target> targets, Function0<String> messageBuilder, Throwable throwable, Boolean onlyOnce, Map<String, Object> additionalProperties)Logs a message from the internal implementation. abstract UnitlogMetric(Function0<String> messageBuilder, Map<String, Object> additionalProperties)Logs a specific metric from the internal implementation. -
-
Method Detail
-
log
abstract Unit log(InternalLogger.Level level, InternalLogger.Target target, Function0<String> messageBuilder, Throwable throwable, Boolean onlyOnce, Map<String, Object> additionalProperties)
Logs a message from the internal implementation.
- Parameters:
level- the severity level of the logtarget- the target handler for the logmessageBuilder- the lambda building the log messagethrowable- an optional throwable erroronlyOnce- whether only one instance of the message should be sent per lifetime of the logger (default isfalse)additionalProperties- additional properties to add to the log
-
log
abstract Unit log(InternalLogger.Level level, List<InternalLogger.Target> targets, Function0<String> messageBuilder, Throwable throwable, Boolean onlyOnce, Map<String, Object> additionalProperties)
Logs a message from the internal implementation.
- Parameters:
level- the severity level of the logtargets- list of the target handlers for the logmessageBuilder- the lambda building the log messagethrowable- an optional throwable erroronlyOnce- whether only one instance of the message should be sent per lifetime of the logger (default isfalse, onlyOnce applies to each target independently)additionalProperties- additional properties to add to the log
-
logMetric
abstract Unit logMetric(Function0<String> messageBuilder, Map<String, Object> additionalProperties)
Logs a specific metric from the internal implementation. The metric values will be sent as key-value pairs in the additionalProperties and as part of the com.datadog.android.telemetry.model.TelemetryDebugEvent.Telemetry event.
- Parameters:
messageBuilder- the lambda building the metric messageadditionalProperties- additional properties to add to the metric
-
-
-
-