Package-level declarations

Types

Link copied to clipboard
value class CallbackKSLog(performLogCallback: SimpleKSLogCallback) : KSLog

Creates simple KSLog which will pass all incoming performLog calls to performLogCallback

Link copied to clipboard
class DefaultKSLog(defaultTag: String, messageFormatter: MessageFormatter = defaultMessageFormatter, logging: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit = KSLoggerDefaultPlatformLoggerLambda) : KSLog

Logger based on KSLoggerDefaultPlatformLoggerLambda or logging parameter

Link copied to clipboard
external interface ExtendedConsole : Console
Link copied to clipboard
interface KSLog

Base interface for any logger

Link copied to clipboard
Link copied to clipboard
typealias MessageFilter = (l: LogLevel, t: String?, Throwable?) -> Boolean
Link copied to clipboard
typealias MessageFormatter = (l: LogLevel, t: String?, m: Any, Throwable?) -> String
Link copied to clipboard
typealias SimpleKSLogCallback = (level: LogLevel, tag: String?, message: Any, throwable: Throwable?) -> Unit
Link copied to clipboard
value class TagLogger(val tag: String) : KSLog

Logger which will use tag as default one in cases when performLog have null tag

Properties

Link copied to clipboard
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
expect var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit

Default logger for current platform. You may change it, but you should remember that it is global logger used in KSLog.default by default

actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
actual var KSLoggerDefaultPlatformLoggerLambda: (level: LogLevel, tag: String, message: Any, throwable: Throwable?) -> Unit
Link copied to clipboard

Creating TagLogger with logTag as base tag

Link copied to clipboard

Creating base tag using class simple name of receiver

Functions

Link copied to clipboard
fun addDefaultKSLog(newDefault: KSLog)

Setting KSLog.default logger to new CallbackKSLog using plus operation

Link copied to clipboard
inline fun KSLog.assert(message: Any)
inline fun KSLog.assert(message: Any, e: Throwable?)
inline fun KSLog.assert(tag: String, message: Any)
inline fun KSLog.assert(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.assert(message: String, e: Throwable)
inline fun KSLog.assert(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.assert(tag: String, message: Any, e: Throwable?)
inline fun KSLog.assert(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.assertS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.assertS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.assertS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline fun KSLog.d(message: Any)
inline fun KSLog.d(message: Any, e: Throwable?)
inline fun KSLog.d(tag: String, message: Any)
inline fun KSLog.d(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.d(message: String, e: Throwable)
inline fun KSLog.d(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.d(tag: String, message: Any, e: Throwable?)
inline fun KSLog.d(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline fun KSLog.debug(message: Any)
inline fun KSLog.debug(message: Any, e: Throwable?)
inline fun KSLog.debug(tag: String, message: Any)
inline fun KSLog.debug(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.debug(message: String, e: Throwable)
inline fun KSLog.debug(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.debug(tag: String, message: Any, e: Throwable?)
inline fun KSLog.debug(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.debugS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.debugS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.debugS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline suspend fun KSLog.dS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.dS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.dS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline fun KSLog.e(message: Any)
inline fun KSLog.e(message: Any, e: Throwable?)
inline fun KSLog.e(tag: String, message: Any)
inline fun KSLog.e(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.e(message: String, e: Throwable)
inline fun KSLog.e(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.e(tag: String, message: Any, e: Throwable?)
inline fun KSLog.e(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline fun KSLog.error(message: Any)
inline fun KSLog.error(message: Any, e: Throwable?)
inline fun KSLog.error(tag: String, message: Any)
inline fun KSLog.error(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.error(message: String, e: Throwable)
inline fun KSLog.error(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.error(tag: String, message: Any, e: Throwable?)
inline fun KSLog.error(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.errorS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.errorS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.errorS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline suspend fun KSLog.eS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.eS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.eS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline fun KSLog.i(message: Any)
inline fun KSLog.i(message: Any, e: Throwable?)
inline fun KSLog.i(tag: String, message: Any)
inline fun KSLog.i(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.i(message: String, e: Throwable)
inline fun KSLog.i(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.i(tag: String, message: Any, e: Throwable?)
inline fun KSLog.i(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline fun KSLog.info(message: Any)
inline fun KSLog.info(message: Any, e: Throwable?)
inline fun KSLog.info(tag: String, message: Any)
inline fun KSLog.info(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.info(message: String, e: Throwable)
inline fun KSLog.info(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.info(tag: String, message: Any, e: Throwable?)
inline fun KSLog.info(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.infoS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.infoS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.infoS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
operator fun KSLog.invoke(performLogCallback: (level: LogLevel, tag: String?, message: Any, throwable: Throwable?) -> Unit): CallbackKSLog
Link copied to clipboard
inline suspend fun KSLog.iS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.iS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.iS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
fun KSLog(performLogCallback: SimpleKSLogCallback): CallbackKSLog

Creating CallbackKSLog using performLogCallback as an argument for constructor

fun KSLog(defaultTag: String): KSLog

Simple builder for DefaultKSLog logger based on defaultTag

fun KSLog(defaultTag: String, messageFormatter: MessageFormatter): KSLog

Simple builder for DefaultKSLog logger based on defaultTag and messageFormatter

fun KSLog(defaultTag: String, minLoggingLevel: LogLevel, messageFormatter: MessageFormatter = defaultMessageFormatter): KSLog

Building logger using KSLog builder based on defaultTag and messageFormatter. This logger will also filter incoming levels: only levels above minLoggingLevel will be logged

fun KSLog(defaultTag: String, levels: Iterable<LogLevel>, messageFormatter: MessageFormatter = defaultMessageFormatter): KSLog

Building logger using KSLog builder based on defaultTag and messageFormatter. This logger will also filter incoming levels: only levels passed in levels param will be logged

fun KSLog(defaultTag: String, firstLevel: LogLevel, secondLevel: LogLevel, vararg otherLevels: LogLevel, messageFormatter: MessageFormatter = defaultMessageFormatter): KSLog

Building logger using KSLog builder based on defaultTag and messageFormatter. This logger will also filter incoming levels: only levels passed in firstLevel, secondLevel and otherLevels param will be logged

fun KSLog(defaultTag: String, logger: Logger, messageFormatter: MessageFormatter = defaultMessageFormatter): CallbackKSLog
fun KSLog(defaultTag: String, logger: Logger, minLoggingLevel: LogLevel = LogLevel.values().first(), messageFormatter: MessageFormatter = defaultMessageFormatter): KSLog
fun KSLog(defaultTag: String, logger: Logger, levels: Iterable<LogLevel>, messageFormatter: MessageFormatter = defaultMessageFormatter): KSLog
fun KSLog(defaultTag: String, logger: Logger, firstLevel: LogLevel, secondLevel: LogLevel, vararg otherLevels: LogLevel, messageFormatter: MessageFormatter = defaultMessageFormatter): KSLog
Link copied to clipboard
inline fun KSLog.l(level: LogLevel, message: Any)
inline fun KSLog.l(level: LogLevel, message: Any, e: Throwable?)
inline fun KSLog.l(level: LogLevel, tag: String, message: Any)
inline fun KSLog.l(level: LogLevel, tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.l(level: LogLevel, message: String, e: Throwable)
inline fun KSLog.l(level: LogLevel, e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.l(level: LogLevel, tag: String, message: Any, e: Throwable?)
inline fun KSLog.l(level: LogLevel, tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline fun KSLog.log(level: LogLevel, message: Any)
inline fun KSLog.log(level: LogLevel, message: Any, e: Throwable?)
inline fun KSLog.log(level: LogLevel, tag: String, message: Any)
inline fun KSLog.log(level: LogLevel, tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.log(level: LogLevel, message: String, e: Throwable)
inline fun KSLog.log(level: LogLevel, e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.log(level: LogLevel, tag: String, message: Any, e: Throwable?)
inline fun KSLog.log(level: LogLevel, tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.logS(level: LogLevel, tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.logS(level: LogLevel, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.logS(level: LogLevel, tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline suspend fun KSLog.lS(level: LogLevel, tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.lS(level: LogLevel, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.lS(level: LogLevel, tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline fun MessageFormatter(noinline formatter: MessageFormatter): (l: LogLevel, t: String?, m: Any, Throwable?) -> String
Link copied to clipboard
fun setDefaultKSLog(newDefault: KSLog)

Setting KSLog.default logger to newDefault

Link copied to clipboard
inline fun KSLog.t(message: Any)
inline fun KSLog.t(message: Any, e: Throwable?)
inline fun KSLog.t(tag: String, message: Any)
inline fun KSLog.t(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.t(message: String, e: Throwable)
inline fun KSLog.t(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.t(tag: String, message: Any, e: Throwable?)
inline fun KSLog.t(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
fun taggedLogger(tagBase: Any): KSLog

Creating TagLogger using logger extension property with tagBase as this

Link copied to clipboard
inline fun KSLog.trace(message: Any)
inline fun KSLog.trace(message: Any, e: Throwable?)
inline fun KSLog.trace(tag: String, message: Any)
inline fun KSLog.trace(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.trace(message: String, e: Throwable)
inline fun KSLog.trace(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.trace(tag: String, message: Any, e: Throwable?)
inline fun KSLog.trace(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.traceS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.traceS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.traceS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline suspend fun KSLog.tS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.tS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.tS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline fun KSLog.v(message: Any)
inline fun KSLog.v(message: Any, e: Throwable?)
inline fun KSLog.v(tag: String, message: Any)
inline fun KSLog.v(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.v(message: String, e: Throwable)
inline fun KSLog.v(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.v(tag: String, message: Any, e: Throwable?)
inline fun KSLog.v(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline fun KSLog.verbose(message: Any)
inline fun KSLog.verbose(message: Any, e: Throwable?)
inline fun KSLog.verbose(tag: String, message: Any)
inline fun KSLog.verbose(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.verbose(message: String, e: Throwable)
inline fun KSLog.verbose(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.verbose(tag: String, message: Any, e: Throwable?)
inline fun KSLog.verbose(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.verboseS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.verboseS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.verboseS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline suspend fun KSLog.vS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.vS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.vS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline fun KSLog.w(message: Any)
inline fun KSLog.w(message: Any, e: Throwable?)
inline fun KSLog.w(tag: String, message: Any)
inline fun KSLog.w(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.w(message: String, e: Throwable)
inline fun KSLog.w(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.w(tag: String, message: Any, e: Throwable?)
inline fun KSLog.w(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline fun KSLog.warning(message: Any)
inline fun KSLog.warning(message: Any, e: Throwable?)
inline fun KSLog.warning(tag: String, message: Any)
inline fun KSLog.warning(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.warning(message: String, e: Throwable)
inline fun KSLog.warning(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.warning(tag: String, message: Any, e: Throwable?)
inline fun KSLog.warning(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.warningS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.warningS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.warningS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline suspend fun KSLog.wS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.wS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.wS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
Link copied to clipboard
inline fun KSLog.wtf(message: Any)
inline fun KSLog.wtf(message: Any, e: Throwable?)
inline fun KSLog.wtf(tag: String, message: Any)
inline fun KSLog.wtf(tag: String, noinline messageBuilder: () -> Any)
inline fun KSLog.wtf(message: String, e: Throwable)
inline fun KSLog.wtf(e: Throwable? = null, noinline messageBuilder: () -> Any)
inline fun KSLog.wtf(tag: String, message: Any, e: Throwable?)
inline fun KSLog.wtf(tag: String?, e: Throwable? = null, noinline messageBuilder: () -> Any)
Link copied to clipboard
inline suspend fun KSLog.wtfS(tag: String, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.wtfS(e: Throwable? = null, noinline messageBuilder: suspend () -> Any)
inline suspend fun KSLog.wtfS(tag: String?, e: Throwable? = null, noinline messageBuilder: suspend () -> Any)