Package 

Interface InternalLogger


  • 
    public interface InternalLogger
    
                        

    A 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.

    • 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 log
        target - the target handler for the log
        messageBuilder - the lambda building the log message
        throwable - an optional throwable error
        onlyOnce - whether only one instance of the message should be sent per lifetime of the logger (default is false)
        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 log
        targets - list of the target handlers for the log
        messageBuilder - the lambda building the log message
        throwable - an optional throwable error
        onlyOnce - whether only one instance of the message should be sent per lifetime of the logger (default is false, 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 message
        additionalProperties - additional properties to add to the metric