Kermit
Kermit copied to clipboard
Kermit 2.0.0-RC4 Gradle Plugin for Log Stripping Example
Description
I can't seem to find an example or means of getting the kermit log stripping plugin to function when upgrading to 2.0.0-RC4.
The feature is mentioned on the Kermit website but not mentioned at all in documentation or samples.
id("co.touchlab.kermit") version "2.0.0-RC4"
yields an "UnknownPluginException" from Gradle, but the same works with version 1.2.2
I'm happy to help with documentation for this once I learn how to get it working again myself.
Thanks
Thank you for another great utility library.
I think the plugin wasn't published for 2.0.0 because we weren't sure it was useful or if people were using it. Were you depending on it in 1.x?
Apologies for the late response. Yes, we were using it to strip logs from ios builds, but can remove it if you don't think it has value or is too much to maintain. We like the idea, but understand if it distracts from the primary features. Also happy to help and learn if there is something we can do to help keep it around.
Stripping log calls would be nice for low level libraries that want all possible optimizations. Example: I'm building a TCP/UDP multiplatform library and while logs are ok during development, I don't want the overhead in production.
I'm also interested in this.
I did a quick attempt on using proguard to remove the log calls, but unfortunatelly it didn't work. Probably some small mistake on my side. I'll debug later.
Here are my proguard rules, on top of the optimized defaults:
# Remove all logging calls from the co.touchlab.kermit package.
-assumenosideeffects class co.touchlab.kermit.Logger {
public final void v(...);
public final void d(...);
public final void i(...);
public final void w(...);
public final void e(...);
public final void a(...);
}
-assumenosideeffects class co.touchlab.kermit.Logger$Companion {
public final void v(...);
public final void d(...);
public final void i(...);
public final void w(...);
public final void e(...);
public final void a(...);
}
Hey, did you get it working?
@kasem-sm unfortunatelly not. I didn't have time to test this further. I'll probably look into it in a couple of months, but as far as I know this should bo doable with proguard.