All Projects → ToxicBakery → Arbor

ToxicBakery / Arbor

Licence: Apache-2.0 License
Like Timber, just different

Programming Languages

kotlin
9241 projects
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to Arbor

moko-web3
Ethereum Web3 implementation for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 32 (-41.82%)
Mutual labels:  kotlin-native, kotlin-multiplatform
kotlin-multiplatform-example
A Kotlin multiplatform example app that targets Android, ReactJS, iOS, JavaFx, and Spring Boot
Stars: ✭ 115 (+109.09%)
Mutual labels:  kotlin-native, kotlin-multiplatform
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (-1.82%)
Mutual labels:  kotlin-native, kotlin-multiplatform
moko-errors
Automated exceptions handler for mobile (android & ios) Kotlin Multiplatform development.
Stars: ✭ 45 (-18.18%)
Mutual labels:  kotlin-native, kotlin-multiplatform
tmdb-api
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.
Stars: ✭ 31 (-43.64%)
Mutual labels:  kotlin-native, kotlin-multiplatform
island-time
A Kotlin Multiplatform library for working with dates and times
Stars: ✭ 69 (+25.45%)
Mutual labels:  kotlin-native, kotlin-multiplatform
moko-graphics
Graphics primitives for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 11 (-80%)
Mutual labels:  kotlin-native, kotlin-multiplatform
KMQTT
Embeddable and standalone Kotlin Multiplatform MQTT broker
Stars: ✭ 56 (+1.82%)
Mutual labels:  kotlin-native, kotlin-multiplatform
chip-8
Jetpack Compose and SwiftUI based Kotlin Multiplatform fork of https://github.com/cbeust/chip-8 (Chip-8 Emulator)
Stars: ✭ 36 (-34.55%)
Mutual labels:  kotlin-native, kotlin-multiplatform
koru
Simple coroutine wrappers for Kotlin Native. Generated from annotations. Compatible with RxSwift, Combine etc.
Stars: ✭ 141 (+156.36%)
Mutual labels:  kotlin-native, kotlin-multiplatform
libs.kmp.icerock.dev
Kotlin Multiplatform libraries list with info auto-fetch
Stars: ✭ 178 (+223.64%)
Mutual labels:  kotlin-native, kotlin-multiplatform
storyblok-mp-SDK
Storyblok Kotlin Multiplatform SDK (Android, JVM, JS, iOS, ...)
Stars: ✭ 16 (-70.91%)
Mutual labels:  kotlin-native, kotlin-multiplatform
devtools-library
Multiplatform, pluggable, extensible, and dynamic config library which supports YAML and JSON as a source.
Stars: ✭ 15 (-72.73%)
Mutual labels:  kotlin-native, kotlin-multiplatform
moko-network
Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 107 (+94.55%)
Mutual labels:  kotlin-native, kotlin-multiplatform
kfsm
Finite State Machine in Kotlin
Stars: ✭ 76 (+38.18%)
Mutual labels:  kotlin-native, kotlin-multiplatform
moko-maps
Control your map from common code for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 47 (-14.55%)
Mutual labels:  kotlin-native, kotlin-multiplatform
CompleteKotlin
Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.
Stars: ✭ 236 (+329.09%)
Mutual labels:  kotlin-native, kotlin-multiplatform
MultiplatformPlayground
Kotlin Multiplatform project in Jetpack Compose & SwiftUI with shared ViewModel layer and File upload
Stars: ✭ 72 (+30.91%)
Mutual labels:  kotlin-native, kotlin-multiplatform
SQLiter
Minimal multiplatform sqlite library
Stars: ✭ 120 (+118.18%)
Mutual labels:  kotlin-native, kotlin-multiplatform
thelema-engine
Thelema - 3D graphics engine, written in Kotlin. Based on sources of libGDX.
Stars: ✭ 51 (-7.27%)
Mutual labels:  kotlin-native, kotlin-multiplatform

arbor

Arbor CircleCI Maven Central Maven Central codecov

Timber like logging implementation for Kotlin Multiplatform.

Purpose

This library was built as a practical experiment with Kotlin Multiplatform and specifically the new single module approach. Despite Kotlin's excellent documentation it was unclear how to properly publish all artifacts to Maven such as sources and documentation. Hopefully this project provides a more complete template for others to use.

API

Arbor follows a very similar usage pattern to Timber. Key differences exist in feature support and terminology which was done purely because I had a thesaurus laying around.

Sow Your Seedling

Seedlings are platform specific logging implementations such as using Logcat in Android and println in JavaScript.

Android

Arbor.sow(LogCatSeedling())

JavaScript

Arbor.sow(Seedling())

JVM

Arbor.sow(Seedling())

Custom seedlings can be created from the com.toxicbakery.logging.ISeedling interface.

Logging

All logging is triggered from the Arbor static methods which supports debug, info, verbose, warning, error, and wtf. Logging calls are passed to the underlying branch implementation and finally to the sown seedling instances.

Arbor.d("Hello World!")

Log tagging is automatic on Android but can be easily overridden.

Arbor.tag("Custom Tag").i("My Log with a tag.")
Kotlin Extensions

While Arbor supports writing string concatenations, leveraging Kotlin concatenations leads to strings being evaluated regardless of if they will be logged. In release that means CPU cycles may be wasted towards logging that is ultimately never printed. The arbor Kotlin extension leverages functions to work around this.

Debug message

arbor { "Debug" }

Changing the log level

arbor(LogLevel.E) { "Error" }

Levering custom tags via Arbor branches

val tag = Arbor.tag("MyTag")
arbor(branch = tag) { "Custom Tag" }

Install

Arbor is a Kotlin Multiplatform project supporting JavaScript, JVM, and Android platforms.

Android

implementation "com.ToxicBakery.logging:arbor-android:1.+"

JavaScript

implementation "com.ToxicBakery.logging:arbor-js:1.+"

JVM

implementation "com.ToxicBakery.logging:arbor-jvm:1.+"

Migrating from Timber

Library migrations can be difficult. I've written a drop in kotlin file that can be placed anywhere in your application for a generally 1:1 mapping of Timber to Arbor. Notably missing is extension functions for string formatting.

https://gist.github.com/ToxicBakery/e55f55ec73450257901431c06eb1e969

Alternately, Kotlin can be leveraged more directly if you prefer.

package timber.log

typealias Timber = com.toxicbakery.logging.Arbor

This has a drawback in that Timber.tag(...) calls will not work.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].