-
public final class Logger.BuilderA Builder class for a Logger.
-
-
Constructor Summary
Constructors Constructor Description Logger.Builder(SdkCore sdkCore)Logger.Builder()
-
Method Summary
Modifier and Type Method Description final Loggerbuild()Builds a Logger based on the current state of this Builder. final Logger.BuildersetService(String service)Sets the service name that will appear in your logs. final Logger.BuildersetRemoteLogThreshold(Integer minLogThreshold)Sets a minimum threshold (priority) for the log to be sent to the Datadog servers. final Logger.BuildersetLogcatLogsEnabled(Boolean enabled)Enables your logs to be duplicated in LogCat. final Logger.BuildersetNetworkInfoEnabled(Boolean enabled)Enables network information to be automatically added in your logs. final Logger.BuildersetName(String name)Sets the logger name that will appear in your logs when a throwable is attached. final Logger.BuildersetBundleWithTraceEnabled(Boolean enabled)Enables the logs bundling with the current active trace. final Logger.BuildersetBundleWithRumEnabled(Boolean enabled)Enables the logs bundling with the current active View. final Logger.BuildersetRemoteSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float sampleRate)Sets the sample rate for this Logger. -
-
Method Detail
-
setService
final Logger.Builder setService(String service)
Sets the service name that will appear in your logs.
- Parameters:
service- the service name (default = application package name)
-
setRemoteLogThreshold
final Logger.Builder setRemoteLogThreshold(Integer minLogThreshold)
Sets a minimum threshold (priority) for the log to be sent to the Datadog servers. If log priority is below this one, then it won't be sent. Default value is -1 (allow all).
- Parameters:
minLogThreshold- Minimum log threshold to be sent to the Datadog servers.
-
setLogcatLogsEnabled
final Logger.Builder setLogcatLogsEnabled(Boolean enabled)
Enables your logs to be duplicated in LogCat.
- Parameters:
enabled- false by default
-
setNetworkInfoEnabled
final Logger.Builder setNetworkInfoEnabled(Boolean enabled)
Enables network information to be automatically added in your logs.
- Parameters:
enabled- false by default
-
setName
final Logger.Builder setName(String name)
Sets the logger name that will appear in your logs when a throwable is attached.
- Parameters:
name- the logger custom name (default = application package name)
-
setBundleWithTraceEnabled
final Logger.Builder setBundleWithTraceEnabled(Boolean enabled)
Enables the logs bundling with the current active trace. If this feature is enabled all the logs from this moment on will be bundled with the current trace and you will be able to see all the logs sent during a specific trace.
- Parameters:
enabled- true by default
-
setBundleWithRumEnabled
final Logger.Builder setBundleWithRumEnabled(Boolean enabled)
Enables the logs bundling with the current active View. If this feature is enabled all the logs from this moment on will be bundled with the current view information and you will be able to see all the logs sent during a specific view in the Rum Explorer.
- Parameters:
enabled- true by default
-
setRemoteSampleRate
final Logger.Builder setRemoteSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float sampleRate)
Sets the sample rate for this Logger.
- Parameters:
sampleRate- the sample rate, in percent.
-
-
-
-