Hi guys. The Kermit website says "Disable local logging for production, or even strip log statements altogether with a compiler plugin". I am interested in the latter i.e. "strip log statements altogether with a compiler plugin". Is such a compiler plugin available? I couldn't find any information on that. If it exists, can somebody please point me to it?
k
kpgalligan
10/11/2023, 11:37 AM
There was. The code is still there (https://github.com/touchlab/Kermit/tree/main/plugin), but we'd need to update it. I added it maybe 2 years ago, as it seemed pretty useful, but we never used it, and nobody I'm aware of did either, so I didn't prioritize it when we did v2. Will add an issue to review bringing that back.
It did quite literally just "erase" all logging calls.
h
Hemant Gokhale
10/11/2023, 10:32 PM
Thank you, Kevin. It would great to have the ability to "erase" the logging calls.
i
Illustrator
05/19/2024, 3:29 PM
Hey, Any updates on this. Any other way to strip logs? Thanks!
k
kpgalligan
05/20/2024, 12:18 AM
No updates. been fully busy with tons of other stuff.
i
Illustrator
05/20/2024, 1:53 PM
So there’s absolutely no way to remove logs? I guess if we set min severity, we can turn the logs off, right?
k
kpgalligan
05/20/2024, 2:59 PM
Oh, yeah! Just set the log level. What we're talking about here was a compiler plugin that actually removed all logging calls from the binary itself. In theory, that would make the binary slightly smaller and have a slight performance increase, but it really wasn't used by anybody.
If you just want to prevent logs from being written, set the min severity.