touchlab / Kermit

Kermit by Touchlab is a Kotlin Multiplatform centralized logging utility.
https://kermit.touchlab.co
Apache License 2.0
718 stars 41 forks source link

Chunked log writer that breaks up long messages #396

Closed psh closed 4 months ago

psh commented 5 months ago

This PR adds a commonMain implementation of log chunking that can be applied to any log writer.

Logger.setLogWriters(platformLogWriter().chunked())
Logger.setTag("MyTag")
Logger.i { "Hello Kotlin" }

The chunked() method defaults parameters for max / min chunking and returns a wrapped log writer that breaks long messages and feeds them to the wrapped writer.

This PR relates to #394

Nek-12 commented 5 months ago

Need to regenerate the api surface @psh

samhill303 commented 4 months ago

@psh I've merged https://github.com/touchlab/Kermit/pull/398 which should allow you to pass CI once you update