DefaultLogSink
A LogSink that writes to each platform's native log output:
Android -
android.util.Log(visible in Logcat)iOS / macOS -
NSLog(visible in the Xcode console)JS / Wasm - the browser or Node.js
consoleJVM / Linux / Windows - standard output
This is the sink installed automatically when LoggerFactory.install is never called, and the recommended one during development: every level appears where developers already look.
The output format is controlled by logFormatter. Defaults to LogFormatters.pretty without emoji.
A throwable is rendered once, by the platform channel itself (on JS as the error object), so logFormatter receives the event without it. As a result LogFormatters.json output from this sink has no error field; use ConsoleSink or RemoteLogSink for pure JSON lines.
Example:
LoggerFactory.install(
LoggerConfig.Builder()
.addSink(DefaultLogSink())
// or with a custom formatter
.addSink(DefaultLogSink(LogFormatters.compact(showEmoji = true)))
.build()
)