StructuredTree
A Timber.Tree that supports structured logging.
Merges per-log fields from StructuredTimber, thread-local context from StructuredLog, and globalFields, then delegates to each registered Sink. This class is safe to use from multiple threads concurrently; field merging is performed on the calling thread using thread-local state.
Timber.plant(
StructuredTree(
sinks = listOf(LogcatSink(), CrashlyticsSink()),
globalFields = mapOf("app_version" to BuildConfig.VERSION_NAME)
)
)Content copied to clipboard
Since
1.0.0
Parameters
sinks
Log destinations. Must not be empty.
globalFields
Attributes automatically attached to every log entry. Defaults to an empty map.