Package org.kodein.log

Types

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

SAM interface that helps to restrain or enhance logs

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

Logger

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

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

LogMapper
Link copied to clipboard
fun interface LogMapper

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

LogReceiver
Link copied to clipboard
fun interface LogReceiver

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

Functions

newLogger
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

now
Link copied to clipboard
expect fun now(): Instant
actual fun now(): Instant
actual fun now(): Instant
toLocalString
Link copied to clipboard
expect fun Instant.toLocalString(): String
actual fun Instant.toLocalString(): String
withShortPackageKeepLast
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)

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

Shrink every Logger.Tag package name to its first letter

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

Shrink Logger.Tag package name to its first letter

Properties

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