Log
Simple logging API for quick, tag-based logging.
All calls are routed through LoggerFactory, so sinks, formatters, and level filtering configured via LoggerFactory.install apply equally to both APIs.
For structured logging with attributes and context, use Logger from LoggerFactory instead.
Usage:
// Direct logging with default tag
Log.i("App started")
Log.e("Error occurred", throwable = exception)
// With custom tag
Log.i("User logged in", tag = "Auth")
// Using class-based tag
class MyViewModel {
private val log = Log.withClassTag<MyViewModel>()
fun doSomething() {
log.d("Doing something")
}
}
// Using custom tag wrapper
val log = Log.withTag("NetworkModule")
log.d("Connecting to server")Content copied to clipboard
Functions
Link copied to clipboard
Sets the default tag used for all Log calls that do not specify an explicit tag. Call this once during application initialization.
Link copied to clipboard
Returns a LogWrapper whose tag is derived from the simple name of class T.
Link copied to clipboard
Returns a LogWrapper that uses tag on every call.