All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.de.halfbit.logger.sink.LogPrinter.kt Maven / Gradle / Ivy

The newest version!
/** Copyright 2024 Halfbit GmbH, Sergej Shafarenka */
package de.halfbit.logger.sink

import de.halfbit.logger.LogLevel
import kotlinx.datetime.Instant

public fun interface LogPrinter {
    public operator fun invoke(
        level: LogLevel, tag: String, timestamp: Instant, message: String?, err: Throwable?
    ): String

    public companion object {
        public val Default: LogPrinter = buildLogPrinter {
            timestamp { timeOnly() }
            tag {
                padded {
                    length(22)
                    useSquareBrackets(false)
                    paddingChar('.')
                }
            }
            logLevel { short() }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy