commonMain.de.halfbit.logger.sink.LogPrinter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of logger-jvm Show documentation
Show all versions of logger-jvm Show documentation
Minimalistic, fast and configurable Logger for Kotlin Multiplatform
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() }
}
}
}