PureeLogger

Main logger class for the Puree-KMP logging system.

PureeLogger is responsible for processing and routing logs to appropriate outputs based on configured filters. It integrates with the application lifecycle to manage buffered outputs efficiently.

Parameters

lifecycle

The application lifecycle used to manage logging states

logSerializer

Serializer to convert log objects to JSON format

logStore

Storage for persisting logs

dispatcher

CoroutineDispatcher for asynchronous log processing

clock

Clock instance for timestamping logs

registeredLogs

Map of registered log types and their configurations

bufferedOutputs

List of outputs that support buffering

Functions

Link copied to clipboard
fun flush()

Flushes all buffered outputs immediately.

Link copied to clipboard
fun <T : PureeLog> postLog(log: T, platformClass: PlatformClass<T>)

Posts a log entry to be processed and routed to configured outputs.

Link copied to clipboard
fun resume()

Resumes all buffered outputs.

Link copied to clipboard
inline fun <T : PureeLog> PureeLogger.send(log: T)

Extension function to send a log to the PureeLogger.

Link copied to clipboard
fun suspend()

Suspends all buffered outputs.