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

Restore global api functions #372

Closed kpgalligan closed 11 months ago

kpgalligan commented 11 months ago

The api refactor cut the global functions that were added for tag convenience.

Reference: https://github.com/touchlab/Kermit/issues/371

sproctor commented 11 months ago

Restoring the global functions seems to have made them ambiguous.

Logger.d(tag = "MyTag") { "debug message" }

Now gives:

e: file:... Overload resolution ambiguity: 
public final fun d(tag: String, throwable: Throwable? = ..., message: () -> String): Unit defined in co.touchlab.kermit.Logger.Companion
public final inline fun d(throwable: Throwable? = ..., tag: String = ..., message: () -> String): Unit defined in co.touchlab.kermit.Logger.Companion
SamC-Apadmi commented 2 months ago

Is there a solution to this ambiguity problem? 👀