blob: 28229e525b3c6ff585140ebb930a39433678ec84 [file] [log] [blame]
package org.apache.logging.log4j.kotlin
import org.apache.logging.log4j.Logger
/**
* An interface-based "mixin" to easily add a log val to a class, named by the enclosing class. This allows
* code like this:
*
* ```
* import org.apache.logging.log4j.kotlin.Logging
*
* class MyClass: Logging {
* override val log: Logger = logger()
* }
*
* ```
*
* A simpler mechanism is to use the class extension directly, like:
*
* ```
* import org.apache.logging.log4j.kotlin.logger
*
* class MyClass {
* val log = logger()
* }
*
* ```
*/
interface Logging {
val log: Logger
fun logger(): Logger = this.javaClass.logger()
}