I’m planning to migrate from microutils-logging/lo...
# touchlab-tools
m
I’m planning to migrate from microutils-logging/logback to kermit (Android app with a view to KMP further down the line). I currently use a wrapper (extension funs) like:
Copy code
val appLogger = KotlinLogging.logger(name = "/")

inline fun logi(message: String) {
    appLogger.info(message)
}
I configure the logger to include the kotlin source filename as a tag, and this is possible (I think) because slf4j grabs the filename from the stacktrace. So there is no need to pass the tag name explicitly. Instead, almost (there are some exceptions but there are ways to handle those too) anywhere, I only need to do:
logi("that was fun")
and the source filename will appear in logcat. However, I can’t see how to do this (or something similar like using the class of the log call site) in kermit. Any pointers please?