
Flavored logging offering story-driven primitives: single-event notes and contextual scrolls, best-effort non-suspending variants, customizable note/scroll/entry savers, and scroll lifecycle enrichment via margins.
A flavored Kotlin Multiplatform logging library
Scribe is a Kotlin Multiplatform logging library built around the ideas from loggingsucks.com, so structured logs can model both single events and longer contextual flows.
| Documentation Page |
note(...) and contextual logging with unrollScroll(...)
flingNote(...) and looseSeal(...)
NoteSaver, ScrollSaver, and EntrySaver
Margin
Add Scribe to your commonMain dependencies:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("com.rafambn:scribe:0.1.0")
}
}
}Create a Scribe and emit a note:
val scribe = Scribe(
shelves = listOf(
NoteSaver { note ->
println("[${note.level}] ${note.tag}: ${note.message}")
}
)
)
scribe.note(
tag = "payments",
message = "starting checkout",
level = Urgency.INFO,
)Use a scroll when you need shared context for a longer flow:
val scribe = Scribe(
shelves = listOf(
ScrollSaver { scroll -> println(scroll) }
),
imprint = mapOf(
"service" to JsonPrimitive("billing"),
"environment" to JsonPrimitive("production"),
)
)
val scroll = scribe.unrollScroll(id = "checkout-42")
scroll.writeString("gateway", "stripe")
scroll.writeNumber("attempt", 1)
scroll.writeBoolean("retry", false)
scroll.seal(success = true)Choose the saver that matches your output flow:
val noteSaver = NoteSaver { note -> println(note) }
val scrollSaver = ScrollSaver { scroll -> println(scroll) }
val entrySaver = EntrySaver { record -> println(record) }A flavored Kotlin Multiplatform logging library
Scribe is a Kotlin Multiplatform logging library built around the ideas from loggingsucks.com, so structured logs can model both single events and longer contextual flows.
| Documentation Page |
note(...) and contextual logging with unrollScroll(...)
flingNote(...) and looseSeal(...)
NoteSaver, ScrollSaver, and EntrySaver
Margin
Add Scribe to your commonMain dependencies:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("com.rafambn:scribe:0.1.0")
}
}
}Create a Scribe and emit a note:
val scribe = Scribe(
shelves = listOf(
NoteSaver { note ->
println("[${note.level}] ${note.tag}: ${note.message}")
}
)
)
scribe.note(
tag = "payments",
message = "starting checkout",
level = Urgency.INFO,
)Use a scroll when you need shared context for a longer flow:
val scribe = Scribe(
shelves = listOf(
ScrollSaver { scroll -> println(scroll) }
),
imprint = mapOf(
"service" to JsonPrimitive("billing"),
"environment" to JsonPrimitive("production"),
)
)
val scroll = scribe.unrollScroll(id = "checkout-42")
scroll.writeString("gateway", "stripe")
scroll.writeNumber("attempt", 1)
scroll.writeBoolean("retry", false)
scroll.seal(success = true)Choose the saver that matches your output flow:
val noteSaver = NoteSaver { note -> println(note) }
val scrollSaver = ScrollSaver { scroll -> println(scroll) }
val entrySaver = EntrySaver { record -> println(record) }