Skip to content

SaintPatrck/troupe

Repository files navigation

Troupe

About Troupe

What is Troupe?

Troupe is a Kotlin Multi-Platform (KMP) port of Timber, renamed as a homage to Bards from D&D 🐉 🎲.

Why create Troupe?

I wanted centralized and uniform logging across all of my other KMP libraries as well as my native mobile, web, and desktop applications.

Why port Timber?

As a user and advocate of Timber it seemed natural to use it as inspiration. Luckily for me it was already written in Kotlin so the core source of the library is the same. Minor tweaks were made to remove Android/JVM specific APIs so that it could be written in commonMain.

What's with the name?

It's a mix of honoring Timber's pun-y naming and my love for D&D. Bards (Trees) are usually responsible for reciting stories like their adventuring counterparts. Since a Bard rarely travels alone and works best with a network of other Bards the library name was chosen to represent "a group of dancers, actors, or other entertainers who tour to different venues.", or Troupe1

Usage

Installation

Maven projects (KMP/JVM/Android)

depedencies {
    // For KMP projects
    implementation("com.saintpatrck.logging:troupe:$version")
    
    // Android only artifacts
    implementation("com.saintpatrck.logging:troupe-android:$version")
    
    // JVM only artifacts
    implementation("com.saintpatrck.logging:troupe-jvm:$version")
}

Subscribe to logs

Subscribe to logs by implementing Bard and recruiting it to the Troupe

KMP/JVM/Android

class MyBard : Bard() {
    override fun sing(priority: Int, tag: String?, message: String, throwable: Throwable?) {
        // Handle log as desired.
    }
}

MacOS/iOS

TBD

Generate logs

KMP/JVM/Android

// Generate DEBUG log
Troupe.d()

// Generate VERBOSE log
Troupe.v()

// Generate INFO log
Troupe.i()

// Generate WARN log
Troupe.w()

// Generate ERROR log
Troupe.e()

// Generate WTF log
Troupe.wtf()

XCode projects(MacOS/iOS)

TBD

Footnotes

  1. Oxford Languages

About

A port of Timber for KMP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published