TransformLogger

open class TransformLogger(logger: Logger, transformLogLevel: (LogLevel) -> LogLevel? = null, transformTag: (String?) -> String?? = null, transformThrowable: (Throwable?) -> Throwable?? = null, transformMessage: (String?) -> String?? = null) : Logger

A Logger that transforms the logs of a given logger before outputting them.

Parameters

logger

the Logger whose results should be transformed

transformLogLevel

When provided, changes the message using this transformation method

Constructors

Link copied to clipboard
constructor(logger: Logger, transformLogLevel: (LogLevel) -> LogLevel? = null, transformTag: (String?) -> String?? = null, transformThrowable: (Throwable?) -> Throwable?? = null, transformMessage: (String?) -> String?? = null)

Functions

Link copied to clipboard
fun Logger.d(message: () -> String)
fun Logger.d(message: String)

Writes log with DEBUG log level and empty tag.

fun Logger.d(throwable: Throwable)

Log exception with DEBUG log level and empty tag.

fun Logger.d(tag: String?, message: () -> String)
fun Logger.d(tag: String?, message: String)
fun Logger.d(tag: String? = null, throwable: Throwable? = null, message: () -> String)

Writes log with DEBUG log level and provided tag.

fun Logger.d(tag: String? = null, throwable: Throwable)

Log exception with DEBUG log level and provided tag.

Link copied to clipboard
fun Logger.debug(message: () -> String)
fun Logger.debug(message: String)

Writes log with DEBUG log level and empty tag.

fun Logger.debug(throwable: Throwable)

Log exception with DEBUG log level and empty tag.

fun Logger.debug(tag: String?, message: () -> String)
fun Logger.debug(tag: String?, message: String)
fun Logger.debug(tag: String? = null, throwable: Throwable? = null, message: () -> String)

Writes log with DEBUG log level and provided tag.

fun Logger.debug(tag: String? = null, throwable: Throwable)

Log exception with DEBUG log level and provided tag.

Link copied to clipboard
fun Logger.e(message: () -> String)
fun Logger.e(message: String)

Writes log with ERROR log level and empty tag.

fun Logger.e(throwable: Throwable)

Log exception with ERROR log level and empty tag.

fun Logger.e(tag: String?, message: () -> String)
fun Logger.e(tag: String?, message: String)
fun Logger.e(tag: String? = null, throwable: Throwable? = null, message: () -> String)

Writes log with ERROR log level and provided tag.

fun Logger.e(tag: String? = null, throwable: Throwable)

Log exception with ERROR log level and provided tag.

Link copied to clipboard
fun Logger.error(message: () -> String)
fun Logger.error(message: String)

Writes log with ERROR log level and empty tag.

fun Logger.error(throwable: Throwable)

Log exception with ERROR log level and empty tag.

fun Logger.error(tag: String?, message: () -> String)
fun Logger.error(tag: String?, message: String)
fun Logger.error(tag: String? = null, throwable: Throwable? = null, message: () -> String)

Writes log with ERROR log level and provided tag.

fun Logger.error(tag: String? = null, throwable: Throwable)

Log exception with ERROR log level and provided tag.

Link copied to clipboard
fun Logger.i(message: () -> String)
fun Logger.i(message: String)

Writes log with INFO log level and empty tag.

fun Logger.i(throwable: Throwable)

Log exception with INFO log level and empty tag.

fun Logger.i(tag: String?, message: () -> String)
fun Logger.i(tag: String?, message: String)
fun Logger.i(tag: String? = null, throwable: Throwable? = null, message: () -> String)

Writes log with INFO log level and provided tag.

fun Logger.i(tag: String? = null, throwable: Throwable)

Log exception with INFO log level and provided tag.

Link copied to clipboard
fun Logger.info(message: () -> String)
fun Logger.info(message: String)

Writes log with INFO log level and empty tag.

fun Logger.info(throwable: Throwable)

Log exception with INFO log level and empty tag.

fun Logger.info(tag: String?, message: () -> String)
fun Logger.info(tag: String?, message: String)
fun Logger.info(tag: String? = null, throwable: Throwable? = null, message: () -> String)

Writes log with INFO log level and provided tag.

fun Logger.info(tag: String? = null, throwable: Throwable)

Log exception with INFO log level and provided tag.

Link copied to clipboard
open override fun log(level: LogLevel, tag: String?, throwable: Throwable?, message: () -> String?)

Writes log with provided level and tag.

Link copied to clipboard
fun Logger.w(message: () -> String)
fun Logger.w(message: String)

Writes log with WARN log level and empty tag.

fun Logger.w(throwable: Throwable)

Log exception with WARN log level and empty tag.

fun Logger.w(tag: String?, message: () -> String)
fun Logger.w(tag: String?, message: String)
fun Logger.w(tag: String? = null, throwable: Throwable? = null, message: () -> String)

Writes log with WARN log level and provided tag.

fun Logger.w(tag: String? = null, throwable: Throwable)

Log exception with WARN log level and provided tag.

Link copied to clipboard
fun Logger.warn(message: () -> String)
fun Logger.warn(message: String)

Writes log with WARN log level and empty tag.

fun Logger.warn(throwable: Throwable)

Log exception with WARN log level and empty tag.

fun Logger.warn(tag: String?, message: () -> String)
fun Logger.warn(tag: String?, message: String)
fun Logger.warn(tag: String? = null, throwable: Throwable? = null, message: () -> String)

Writes log with WARN log level and provided tag.

fun Logger.warn(tag: String? = null, throwable: Throwable)

Log exception with WARN log level and provided tag.