-
Notifications
You must be signed in to change notification settings - Fork 61
InternalLogger
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).
-
- Level.ERROR: for any actionable error originated from a user's configuration, preventing a feature from working, or for an issue resulting in unexpected data loss;
- Level.WARN: to inform of an actionable misconfiguration or missuses of the SDK, resulting in delayed or incomplete data;
- Level.INFO: information about important expected event (e.g.: successful upload);
- Target.TELEMETRY: any event that need to be tracked for usage monitoring or for error diagnostic.
-
- Level.ERROR, Level.WARN: for any critical error that is unexpected enough and actionable;
- Level.INFO, Level.DEBUG, Level.VERBOSE: important information about critical parts of the SDK we want to monitor;
- 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.
-
- Level.ERROR: for any caught error or situation preventing the SDK from working as expected;
- Level.WARN: for any unexpected situation (e.g.: when one would use an IllegalStateException);
- Level.INFO: information about internal high level steps of the SDK core or features;
- Level.DEBUG: information about internal low level steps of the SDK core or features;
- Level.VERBOSE: information on currently debugged feature or open ticket;
abstract fun log(level: InternalLogger.Level, target: InternalLogger.Target, messageBuilder: () -> String, throwable: Throwable? = null, onlyOnce: Boolean = false, additionalProperties: Map<String, Any?>? = null)
Logs a message from the internal implementation.
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 |
abstract fun log(level: InternalLogger.Level, targets: List<InternalLogger.Target>, messageBuilder: () -> String, throwable: Throwable? = null, onlyOnce: Boolean = false, additionalProperties: Map<String, Any?>? = null)
Logs a message from the internal implementation.
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 |
abstract fun logMetric(messageBuilder: () -> String, additionalProperties: Map<String, Any?>, samplingRate: Float)
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.
messageBuilder | the lambda building the metric message |
additionalProperties | additional properties to add to the metric |
samplingRate | value between 0-100 for sampling the event. Note that the sampling rate applied to this metric will be applied in addition to the global telemetry sampling rate. |
abstract fun startPerformanceMeasure(callerClass: String, metric: TelemetryMetricType, samplingRate: Float, operationName: String): PerformanceMetric?
Start measuring a performance metric.
a PerformanceMetric object that can later be used to send telemetry, or null if sampled out
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 |
- Datadog
- DatadogSite
- _InternalProxy
- InternalLogger
- SdkCore
- DatadogContext
- DeviceInfo
- DeviceType
- NetworkInfo
- ProcessInfo
- TimeInfo
- UserInfo
- Feature
- FeatureContextUpdateReceiver
- FeatureEventReceiver
- FeatureScope
- FeatureSdkCore
- StorageBackedFeature
- Request
- RequestFactory
- DataWriter
- EventBatchWriter
- EventType
- FeatureStorageConfiguration
- RawBatchEvent
- DataStoreHandler
- DataStoreReadCallback
- DataStoreWriteCallback
- InternalSdkCore
- SdkReference
- BackPressureMitigation
- BackPressureStrategy
- BatchProcessingLevel
- BatchSize
- Configuration
- HostsSanitizer
- UploadFrequency
- UploadSchedulerStrategy
- DataConstraints
- DatadogDataConstraints
- ThreadDump
- DefaultFirstPartyHostHeaderTypeResolver
- FirstPartyHostHeaderTypeResolver
- Deserializer
- BuildSdkVersionProvider
- JsonSerializer
- MethodCallSamplingRate
- PerformanceMetric
- TelemetryMetricType
- PersistenceStrategy
- Serializer
- DataStoreContent
- RateBasedSampler
- Sampler
- FlushableExecutorService
- EventMapper
- MapperSerializer
- NoOpEventMapper
- LogAttributes
- TrackingConsent
- TrackingConsentProviderCallback
- Encryption
- TracingHeaderType
- DdRumContentProvider
- GlobalRumMonitor
- Rum
- RumActionType
- RumAttributes
- RumConfiguration
- RumErrorSource
- RumMonitor
- RumPerformanceMetric
- RumResourceAttributesProvider
- RumResourceKind
- RumResourceMethod
- RumSessionListener
- _RumInternalProxy
- VitalsUpdateFrequency
- ViewEventMapper
- ResourceTiming
- AdvancedNetworkRumMonitor
- ResourceId
- RumResourceInputStream
- AcceptAllActivities
- AcceptAllDefaultFragment
- AcceptAllNavDestinations
- AcceptAllSupportFragments
- ActivityLifecycleTrackingStrategy
- ActivityViewTrackingStrategy
- ComponentPredicate
- FragmentViewTrackingStrategy
- InteractionPredicate
- MixedViewTrackingStrategy
- NavigationViewTrackingStrategy
- TrackingStrategy
- ViewAttributesProvider
- ViewTrackingStrategy
- DatadogDatabaseErrorHandler
- ActionEvent
- ErrorEvent
- LongTaskEvent
- ResourceEvent
- ViewEvent
- TelemetryConfigurationEvent
- TelemetryDebugEvent
- TelemetryErrorEvent
- ExtensionSupport
- ImagePrivacy
- MapperTypeWrapper
- SessionReplay
- SessionReplayConfiguration
- SessionReplayPrivacy
- MappingContext
- OptionSelectorDetector
- SystemInformation
- BaseAsyncBackgroundWireframeMapper
- BaseViewGroupMapper
- BaseWireframeMapper
- EditTextMapper
- TextViewMapper
- TraverseAllChildrenMapper
- WireframeMapper
- AndroidMDrawableToColorMapper
- AndroidQDrawableToColorMapper
- AsyncJobStatusCallback
- ColorStringFormatter
- DefaultColorStringFormatter
- DefaultViewBoundsResolver
- DefaultViewIdentifierResolver
- DrawableToColorMapper
- GlobalBounds
- ImageWireframeHelper
- LegacyDrawableToColorMapper
- ViewBoundsResolver
- ViewIdentifierResolver
- MobileSegment
- ResourceHashesEntry
- ResourceMetadata