``` interface TLogger { fun debug(tag: String...
# announcements
a
Copy code
interface TLogger  {
    fun debug(tag: String, msg: () -> String)
}

class MyLogger : TLogger {
    override fun debug(tag: String, msg: () -> String) {
       writeLogLine( "//DateTime \t tag \t ${ msg() }") //Logger formats the whole log-line
    }
}


//Consumer
logger.debug("HERE", { "Result: ${ doHeavyComputation() }") //Client just tells the Logger how to create the expensive message, not how to format the log-line