Kotlin doesn\'t have the same notion of static fields as used in Java. In Java, the generally accepted way of doing logging is:
public class Foo { privat
Slf4j example, same for others. This even works for creating package level logger
/** * Get logger by current class name. */ fun getLogger(c: () -> Unit): Logger = LoggerFactory.getLogger(c.javaClass.enclosingClass)
Usage:
val logger = getLogger { }