-
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, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float creationSampleRate)Logs a specific metric from the internal implementation. abstract PerformanceMetricstartPerformanceMeasure(String callerClass, TelemetryMetricType metric, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate, String operationName)Start measuring a performance metric. abstract UnitlogApiUsage(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate, Function0<InternalTelemetryEvent.ApiUsage> apiUsageEventBuilder)Logs an API usage 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, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float creationSampleRate)
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 metricsamplingRate- value between 0-100 for sampling the event.creationSampleRate- value between 0-100.
-
startPerformanceMeasure
abstract PerformanceMetric startPerformanceMeasure(String callerClass, TelemetryMetricType metric, @FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate, String operationName)
Start measuring a performance metric.
- Parameters:
callerClass- name of the class calling the performance measurement.metric- name of the metric that we want to measure.samplingRate- value between 0-100 for sampling the event.operationName- the name of the operation being measured
-
logApiUsage
abstract Unit logApiUsage(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float samplingRate, Function0<InternalTelemetryEvent.ApiUsage> apiUsageEventBuilder)
Logs an API usage from the internal implementation.
- Parameters:
samplingRate- value between 0-100 for sampling the event.apiUsageEventBuilder- the lambda building the API event being tracked
-
-
-
-