Emitter

interface Emitter

An instance of this interface can produce logs.

Note, that this interface does not define a Sink. The library is free to choose a name for a log sink, or even have multiple sinks if necessary.

Example

class MyManager : Log.Emitter {
var logger: Log.Sink<MyCategory>? = Log.Sink.Null

fun doSomething() {
logger?.info(MyCategory.A) { "Action performed" }
}
}

Inheritors

Functions

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.d(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.d(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.DEBUG level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.debug(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.debug(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.DEBUG level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.e(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.e(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.ERROR level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.error(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.error(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.ERROR level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.i(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.i(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.INFO level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.info(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.info(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.INFO level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.log(category: C, level: Log.Level, throwable: Throwable)

A shortcut for logging only a throwable. The message is taken from the throwable.

open fun <C : Log.Category> Log.Sink<C>.log(category: C, level: Log.Level, throwable: Throwable?, message: () -> String)

Log a message with the given category and level.

Link copied to clipboard
open fun <C : Log.Category> Relay(sink: () -> Log.Sink<C>?): Log.Sink<C>

Relay is a Sink that forwards logs to another Sink.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.t(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.t(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.TRACE level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.trace(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.trace(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.TRACE level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.v(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.v(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.TRACE level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.verbose(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.verbose(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.TRACE level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.w(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.w(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.WARN level.

Link copied to clipboard
open fun <C : Log.Category> Log.Sink<C>.warn(category: C, throwable: Throwable)
open fun <C : Log.Category> Log.Sink<C>.warn(category: C, throwable: Throwable? = null, message: () -> String)

Convenience methods for logging at Level.WARN level.