SLF4J 2 binding for Jake Wharton's Timber Android logging library
This is a fork of repository from arcao. The main differences are:
- SLF4J 2+ support
Other differences:
- Updated all dependencies, including Gradle
- Migrated to Kotlin and Kotlin DSL for gradle files
- Migrated infrastructure to Github Actions
- Migration of publishing to Maven Central (instead of the deprecated OSSRH)
Just put slf4j2-timber
, timber
and slf4j-api
(see note in Download)
artifacts to your project and use slf4j
like before:
import com.sun.org.slf4j.internal.LoggerFactory
class YourClass {
private val logger = LoggerFactory.getLogger(YourClass::class.java)
fun yourMethod() {
logger.debug("Hello, world!")
}
}
Don't forget to plant tree to Timber, check Timber usage.
Download the latest AAR or grab it via Maven:
<dependency>
<groupId>uk.kulikov</groupId>
<artifactId>slf4j2-timber</artifactId>
<version>1.2</version>
</dependency>
or Gradle Kotlin DSL:
implementation("uk.kulikov:slf4j2-timber:1.2")
or Gradle Groovy:
implementation 'uk.kulikov:slf4j2-timber:1.2'
Note:
timber
andslf4j-api
are the transitive dependencies ofslf4j2-timber
, so you don't need to take care of them in Maven POM and Gradle build script.
slf4j2-timber | Timber | SLF4J |
---|---|---|
1.2 | 5.0.1 | 2.0.16 |
1.0, 1.1 | 5.0.1 | 2.0.13 |