DefaultLogSink
class DefaultLogSink(logFormatter: LogEventFormatter = LogFormatters.pretty(false)) : LogSink(source)
A LogSink that delegates to the platform's native logging mechanism.
On each platform this maps to the most appropriate native output:
Android -
android.util.Log(visible in Logcat)iOS / macOS -
NSLog(visible in Xcode console)JVM -
java.util.logging.LoggerJS / Wasm -
console.log/console.erroretc.Linux / Windows -
printlnto standard output
This is the recommended sink for most applications because it integrates with the platform's existing log infrastructure (filtering, log levels, crash reporting hooks, etc.).
The output format is controlled by logFormatter. Defaults to LogFormatters.pretty without emoji.
Example:
LoggerFactory.install(
LoggerConfig.Builder()
.addSink(DefaultLogSink())
// or with a custom formatter
.addSink(DefaultLogSink(LogFormatters.compact(showEmoji = true)))
.build()
)Content copied to clipboard