Package org.kodein.log

Types

Link copied to clipboard
expect class Instant
actual typealias Instant = <ERROR CLASS>
actual class Instant(val tv_sec: <ERROR CLASS>, val tv_nsec: Long)
Link copied to clipboard
fun interface LogFilter

SAM interface that helps to restrain or enhance logs

Link copied to clipboard
fun interface LogFrontend
Link copied to clipboard
class Logger(    tag: Logger.Tag,     frontEnds: Collection<LogFrontend>,     filters: List<LogFilter> = emptyList(),     mappers: List<LogMapper> = emptyList())

Logger

Link copied to clipboard
class LoggerFactory(    frontends: Collection<LogFrontend>,     filters: List<LogFilter> = emptyList(),     mappers: List<LogMapper> = emptyList())

Factory for Logger that aims to carry a common configuration for all the Loggers of your application.

Link copied to clipboard
fun interface LogMapper

SAM interface that helps altering each log depending on the filter implementation.

Link copied to clipboard
fun interface LogReceiver

SAM interface that helps defining what to do with a given Logger.Entry

Functions

Link copied to clipboard
inline fun <T> LoggerFactory.newLogger(): Logger

Create a Tag is mapped from the type parameter KClass

inline fun <T> T.newLogger(factory: LoggerFactory): Logger

Create a Tag is mapped from type receiver T

fun LoggerFactory.newLogger(cls: KClass<*>): Logger

Create new Logger from a KClass

fun LoggerFactory.newLogger(pkg: String, name: String): Logger

Create new Logger from a package/name pair mapped to a Tag

Link copied to clipboard
expect fun now(): Instant
actual fun now(): Instant
actual fun now(): Instant
Link copied to clipboard
expect fun Instant.toLocalString(): String
actual fun Instant.toLocalString(): String
Link copied to clipboard
fun LogFrontend.withShortPackageKeepLast(count: Int): LogFrontend

Shrink Logger.Tag package name to its first letter, except for the last one(s)

Link copied to clipboard
fun LogFrontend.withShortPackages(): LogFrontend

Shrink every Logger.Tag package name to its first letter

Link copied to clipboard
fun LogFrontend.withShortPackageShortenFirst(count: Int): LogFrontend

Shrink Logger.Tag package name to its first letter

Properties

Link copied to clipboard
expect val KClass<*>.platformPackageName: String
actual val KClass<*>.platformPackageName: String
actual val KClass<*>.platformPackageName: String
actual val KClass<*>.platformPackageName: String
Link copied to clipboard
expect val KClass<*>.platformSimpleName: String
actual val KClass<*>.platformSimpleName: String
actual val KClass<*>.platformSimpleName: String
actual val KClass<*>.platformSimpleName: String