
Logging to console, files, network, SigNoz and Firebase; global crash handling across coroutines, threads and native signals; install wrapper protects entry point and writes persistent, async-signal-safe crash reports.
Print is a modern Kotlin Multiplatform logging library with built-in crash handling.
It provides a single API for structured logging across JVM, Android, iOS, Kotlin/Native, JavaScript, and WebAssembly, while automatically capturing uncaught exceptions, native crashes, coroutine failures, and browser errors.
Print automatically installs platform-specific crash handlers:
SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS)window.onerror, unhandledrejection)Crash reports are automatically forwarded to every configured logger.
| Platform | Console | File | Network | SigNoz | Firebase | Crash Handling |
|---|---|---|---|---|---|---|
| Android | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| iOS | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Desktop JVM | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Desktop Native (Windows / Linux / macOS) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| JavaScript | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| WebAssembly | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
dependencies {
implementation("io.github.cheerwizard:print:<version>")
}Install Print once during application startup.
Everything executed inside the installation block is protected by Print's crash handlers.
Print.install(
logLevel = LogLevel.WARNING,
crashReportFilepath = "logs/crash-report.log",
loggers = setOf(
ConsoleLogger(),
FileLogger(filepath),
SignozLogger(host),
FirebaseLogger(clientId, secret, measurementId)
)
) {
// Application entry point
}After installation, logging is available globally:
Print.v("Renderer", "Renderer initialized")
Print.i("Game", "Game started")
Print.d("Assets", "Loading textures")
Print.w("Network", "Connection lost")
Print.e("Physics", "Simulation failed")
Print.f("Engine", "Fatal error")enum class LogLevel {
NONE,
VERBOSE,
INFO,
DEBUG,
WARNING,
ERROR,
FATAL
}The configured level acts as the global minimum severity. Events below it are ignored before reaching any logger.
Writes formatted logs to the platform console.
ConsoleLogger()Stores logs locally.
Crash reports are also written to the configured file.
On JavaScript and WebAssembly, IndexedDB is used when available.
FileLogger(
filepath = "/logs/application.log"
)Sends structured log events to a SigNoz endpoint.
SignozLogger(
host = "https://ingest.signoz.io"
)Uploads logs and crash information to Firebase Analytics / Crashlytics.
FirebaseLogger(
clientId = "...",
secret = "...",
measurementId = "G-XXXXXXXXXX"
)Create your own destination by implementing either Logger or NetworkLogger.
class MyLogger : Logger {
override fun log(
level: LogLevel,
tag: String,
message: String
) {
// custom implementation
}
}Crash handling is enabled automatically.
No additional configuration is required.
| Crash Source | Supported Platforms |
|---|---|
| Coroutine exceptions | All |
| Thread uncaught exceptions | JVM, Android |
| Native signals | Android, Desktop Native, Desktop JVM |
| Browser exceptions | JavaScript, WebAssembly |
| iOS uncaught exceptions | iOS |
Native signal handlers use async-signal-safe APIs to ensure crash reports are written before process termination whenever possible.
Unlike traditional logging libraries, Print combines:
behind a single Kotlin Multiplatform API.
Licensed under the Apache License, Version 2.0.
See the LICENSE file for details.
Print is a modern Kotlin Multiplatform logging library with built-in crash handling.
It provides a single API for structured logging across JVM, Android, iOS, Kotlin/Native, JavaScript, and WebAssembly, while automatically capturing uncaught exceptions, native crashes, coroutine failures, and browser errors.
Print automatically installs platform-specific crash handlers:
SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS)window.onerror, unhandledrejection)Crash reports are automatically forwarded to every configured logger.
| Platform | Console | File | Network | SigNoz | Firebase | Crash Handling |
|---|---|---|---|---|---|---|
| Android | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| iOS | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Desktop JVM | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Desktop Native (Windows / Linux / macOS) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| JavaScript | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| WebAssembly | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
dependencies {
implementation("io.github.cheerwizard:print:<version>")
}Install Print once during application startup.
Everything executed inside the installation block is protected by Print's crash handlers.
Print.install(
logLevel = LogLevel.WARNING,
crashReportFilepath = "logs/crash-report.log",
loggers = setOf(
ConsoleLogger(),
FileLogger(filepath),
SignozLogger(host),
FirebaseLogger(clientId, secret, measurementId)
)
) {
// Application entry point
}After installation, logging is available globally:
Print.v("Renderer", "Renderer initialized")
Print.i("Game", "Game started")
Print.d("Assets", "Loading textures")
Print.w("Network", "Connection lost")
Print.e("Physics", "Simulation failed")
Print.f("Engine", "Fatal error")enum class LogLevel {
NONE,
VERBOSE,
INFO,
DEBUG,
WARNING,
ERROR,
FATAL
}The configured level acts as the global minimum severity. Events below it are ignored before reaching any logger.
Writes formatted logs to the platform console.
ConsoleLogger()Stores logs locally.
Crash reports are also written to the configured file.
On JavaScript and WebAssembly, IndexedDB is used when available.
FileLogger(
filepath = "/logs/application.log"
)Sends structured log events to a SigNoz endpoint.
SignozLogger(
host = "https://ingest.signoz.io"
)Uploads logs and crash information to Firebase Analytics / Crashlytics.
FirebaseLogger(
clientId = "...",
secret = "...",
measurementId = "G-XXXXXXXXXX"
)Create your own destination by implementing either Logger or NetworkLogger.
class MyLogger : Logger {
override fun log(
level: LogLevel,
tag: String,
message: String
) {
// custom implementation
}
}Crash handling is enabled automatically.
No additional configuration is required.
| Crash Source | Supported Platforms |
|---|---|
| Coroutine exceptions | All |
| Thread uncaught exceptions | JVM, Android |
| Native signals | Android, Desktop Native, Desktop JVM |
| Browser exceptions | JavaScript, WebAssembly |
| iOS uncaught exceptions | iOS |
Native signal handlers use async-signal-safe APIs to ensure crash reports are written before process termination whenever possible.
Unlike traditional logging libraries, Print combines:
behind a single Kotlin Multiplatform API.
Licensed under the Apache License, Version 2.0.
See the LICENSE file for details.