touchlab / Kermit

Kermit by Touchlab is a Kotlin Multiplatform centralized logging utility.
https://kermit.touchlab.co
Apache License 2.0
699 stars 40 forks source link

Kermit not using default parameters in iOS with the version 2.0.0 and above #373

Open mustafaozhan opened 11 months ago

mustafaozhan commented 11 months ago

In the past, I was able to use the below in my iOS codebase:

    logger.i(message: { "Application init" })

but with the latest version it complains that I am missing the tag and the throwable. I created below extensions for now

extension KermitLogger {
    func i(message: @escaping () -> String) {
        self.i(throwable: nil, tag: "Kermit", message: message)
    }
    func d(message: @escaping () -> String) {
        self.d(throwable: nil, tag: "Kermit", message: message)
    }
    func w(message: @escaping () -> String) {
        self.w(throwable: nil, tag: "Kermit", message: message)
    }
    func v(message: @escaping () -> String) {
        self.v(throwable: nil, tag: "Kermit", message: message)
    }
    func e(message: @escaping () -> String) {
        self.e(throwable: nil, tag: "Kermit", message: message)
    }
    func a(message: @escaping () -> String) {
        self.a(throwable: nil, tag: "Kermit", message: message)
    }
}

But I think kermit should use the defaults, by default like before.