Km Module Log
Wrapper for KmLog that allows library modules to also use KmLogging and be able to enable or disable its logging independently of the application that is also using KmLogging.
Example usage with code implemented in ChartsLogging.kt
object ChartsLogging {
var enabled = true
}
fun moduleLogging(tag: String? = null): KmModuleLog {
// string passed into createTag should be the name of the class that this function is implemented in
// if it is a top level function then the class name is the file name with Kt appended
val t = tag ?: KmLogging.createTag("ChartsLoggingKt").first
return KmModuleLog(logging(t), ChartsLogging::enabled)
}Content copied to clipboard