### Timber.e exception logging with Kotlin lambda Source: https://github.com/ajalt/timberkt/blob/master/README.md Shows how to log exception objects with the standard Timber API versus the Kotlin extension. The lambda is only evaluated if the message is logged, and the same message and tags are logged in all cases. ```kotlin // Standard timber Timber.e(exception, "%d exceptions", errorCount) // Kotlin extensions Timber.e(exception) { "$errorCount exceptions" } // or e(exception) { "$errorCount exceptions" } ``` -------------------------------- ### Apache License 2.0 for timberkt Source: https://github.com/ajalt/timberkt/blob/master/README.md The Apache License 2.0 text for the timberkt project. It grants permission to use, copy, and distribute the software under the specified terms. ```text Copyright 2017-2018 AJ Alt 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. ``` -------------------------------- ### Timber.d debug logging with Kotlin lambda Source: https://github.com/ajalt/timberkt/blob/master/README.md Shows the standard Timber debug call with format arguments compared to the Kotlin extension using a lambda. The lambda is only evaluated if the message is logged, and only once even if multiple trees log it. All extension methods are inlined, so there is no method count penalty. ```kotlin // Standard timber Timber.d("%d %s", intVar + 3, stringFun()) // Kotlin extensions Timber.d { "${intVar + 3} ${stringFun()}" } // or d { "${intVar + 3} ${stringFun()}" } ``` -------------------------------- ### Add timberkt dependency with Gradle Source: https://github.com/ajalt/timberkt/blob/master/README.md Adds the timberkt library as a dependency in a Gradle build script. The library is distributed via Maven Central, JCenter, and JitPack. ```groovy implementation 'com.github.ajalt:timberkt:1.5.1' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.