Package com.launchdarkly.sdk.android
Class LDTimberLogging.Adapter
- java.lang.Object
-
- com.launchdarkly.sdk.android.LDTimberLogging.Adapter
-
- All Implemented Interfaces:
LDLogAdapter
,LDLogAdapter.IsConfiguredExternally
- Enclosing class:
- LDTimberLogging
public static final class LDTimberLogging.Adapter extends java.lang.Object implements LDLogAdapter, LDLogAdapter.IsConfiguredExternally
A Timber implementation of theLDLogAdapter
interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.launchdarkly.logging.LDLogAdapter
LDLogAdapter.Channel, LDLogAdapter.IsConfiguredExternally
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LDTimberLogging.Adapter
autoPlantDebugTree(boolean autoPlantDebugTree)
Returns a modified logging adapter with the automatic debug tree behavior changed.LDLogAdapter.Channel
newChannel(java.lang.String name)
-
-
-
Method Detail
-
autoPlantDebugTree
public LDTimberLogging.Adapter autoPlantDebugTree(boolean autoPlantDebugTree)
Returns a modified logging adapter with the automatic debug tree behavior changed.By default, this property is true, meaning that the SDK will automatically call
Timber.plant(new Timber.DebugTree)
at initialization time if and only ifBuildConfig.DEBUG
is true. If you set it to false as shown below, then the SDK will never create aDebugTree
and the application is responsible for doing so if desired.LDConfig config = new LDConfig.Builder() .mobileKey("mobile-key") .logAdapter(LDTimberLogging.adapter().autoPlantDebugTree(false)) .build();
In a future version, this automatic behavior may be removed, since it is arguably more correct for library code to leave all Tree-planting to the application. The behavior is retained in the current release for backward compatibility.
- Parameters:
autoPlantDebugTree
- true to retain the default automaticDebugTree
behavior, or false to disable it- Returns:
- a modified
LDTimberLogging.Adapter
with the specified behavior
-
newChannel
public LDLogAdapter.Channel newChannel(java.lang.String name)
- Specified by:
newChannel
in interfaceLDLogAdapter
-
-