Package-level declarations

Types

Link copied to clipboard
open class Logger(val name: String, val debugTag: String = DEBUG, val infoTag: String = INFO, val errorTag: String = ERROR)

A simple logging utility class that includes its name in the logged messages.

Properties

Link copied to clipboard
const val DEBUG: String

Debug logging tag.

Link copied to clipboard
const val ERROR: String

Error logging tag.

Link copied to clipboard
const val INFO: String

Info logging tag.

Functions

Link copied to clipboard
inline fun debug(tag: String = DEBUG, message: () -> String)
inline fun debug(cause: Throwable, tag: String = DEBUG, message: () -> String)

Logs a message on the debug level.

Link copied to clipboard
inline fun error(tag: String = ERROR, message: () -> String)
inline fun error(cause: Throwable, tag: String = ERROR, message: () -> String)

Logs a message on the error level.

Link copied to clipboard
inline fun info(tag: String = INFO, message: () -> String)
inline fun info(cause: Throwable, tag: String = INFO, message: () -> String)

Logs a message on the info level.

Link copied to clipboard
inline fun <T : Any> logger(): Logger

Allows to create a Logger instance for a specific class. Note that loggers are not cached - each time this method is called, a new instance of Logger is created, so it is advised to use loggers in companion objects.