DefaultKSLog

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

Logger based on KSLoggerDefaultPlatformLoggerLambda or logging parameter

Parameters

defaultTag

will be used in case when tag parameter in performLog omitted

messageFormatter

special formatter which creating String inside of performLog for each call. Defaults to defaultMessageFormatter

logging

target lambda which will be called with a result of messageFormatter logs formatting as a message and tag as tag if not null and defaultTag otherwise

Constructors

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

Functions

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

Creates FilterKSLog with applying of filter to it

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
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
open override fun performLog(level: LogLevel, tag: String?, message: Any, throwable: Throwable?)

The only one function required to realization in any inheritor. All other performLog functions will call this one by default

open override fun performLog(level: LogLevel, tag: String?, throwable: Throwable?, messageBuilder: () -> Any)

Calls default performLog with message built using messageBuilder. This method supposed to be overriden in case when logger supports lazy-loaded messages (like dev.inmo.kslog.common.filter.FilterKSLog)

open fun performLog(level: LogLevel, message: Any, throwable: Throwable?)

Calls default performLog with tag == null

Link copied to clipboard
open suspend override fun performLogS(level: LogLevel, tag: String?, throwable: Throwable?, messageBuilder: suspend () -> Any)

Suspendable variant of performLog with messageBuilder. Uses default performLog with message built using messageBuilder by default

Link copied to clipboard
infix operator fun KSLog.plus(other: KSLog): CallbackKSLog

Will send KSLog.performLog of both this and other instances. In case when this will throw exception result logger will rethrow it. After it, if other will throw exception - will also rethrow it

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
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)