Is it possible to configure Kermit to remove logs ...
# touchlab-tools
g
Is it possible to configure Kermit to remove logs in release builds on Android (and preferably IOS as well) similar to how Timber works?
k
Do you have a quick link to how timber works? You can configure Kermit in your application set up, and in android or iOS you should be able to figure out the build profile. Then you can either have no log writers, or something like just crash lytics. I have an example somewhere, but I have to dig.
On the crazy end of the spectrum, Kermit used to have a compiler plug-in that would quite literally remove the logging calls in the compiler phase. The statements would be gone entirely. However, I never heard of anybody using it, and the first time somebody ever asked was after I removed it.
😀 1
g
Here’s a link on Timber. https://medium.com/@dilip2882/better-logging-with-timber-in-androidintroduction-73e83342b278 What we are doing in our Android app currently is that we have an init block in our *Debug*App like this:
Copy code
class DebugAppInit @Inject constructor(
    private val timberTree: AutomaticTagLogcatTree,
) : AppInit {
    override fun invoke() {
        Timber.plant(timberTree)
    }
}
In our release build we don’t plant any trees and hence we don’t get any logs. It sounds like I could do something similar with Kermit, do you happen to have any docs on how to do so or any examples available on how to configure it in my application setup?