A logger based entirely on Timber's excellent small, extensible API.
I needed similar logging functionality in a pure Kotlin module, and so Lumber was born.
Lumber comes with an accompanying library lumber-android
that contains a debug tree configured
in a similar fashion as Timber's DebugTree
.
Behavior is added through Tree
instances. You can install an instance by calling Lumber.plant
.
Installation of Tree
s should be done as early as possible.
The DebugTree
implementation will automatically figure out from which class it's being called and
use that class name as its tag. While it uses java.util.logging.Logger
for the actual logging, the
DebugTree
can be extended and made to use what ever utility you want.
"There are no Tree
implementations installed by default because every time you log in production, a
puppy dies." - Jake Wharton
Two easy steps:
- Install any
Tree
instances you want early on in your application.- You can use
is.hth:lumber-android
and it'sAndroidDebugTree
in Android applications to achieve the same functionality as when using Timber'sDebugTree
- You can use
- Call
Lumber
's static methods everywhere throughout your app.
repositories {
mavenCentral()
}
dependencies {
implementation 'is.hth:lumber:0.1.1'
}
Snapshots of the development version are available in Sonatype's snapshots repository.
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
implementation 'is.hth:lumber:0.1.2-SNAPSHOT'
}
Copyright 2022 Hrafn Thorvaldsson
Copyright 2013 Jake Wharton
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.