Closed jeffdgr8 closed 1 year ago
That is what https://github.com/touchlab/Kermit/tree/main/kermit-simple is for. Export that to non-kotlin clients.
Also, without spoiling anything, keep an eye on our announcements for the next couple weeks.
Export that to non-kotlin clients.
How should this be done? I currently have:
val commonMain by getting {
dependencies {
api("co.touchlab:kermit:2.0.0-RC5")
}
}
I tried adding:
val iosMain by getting {
dependencies {
api("co.touchlab:kermit-simple:2.0.0-RC5")
}
}
But the type is still KermitLogger : Kermit_coreBaseLogger
in my exported framework.
keep an eye on our announcements for the next couple weeks.
Will do!
Looks like ~I'd need to make it an implementation
dependency in commonMain
. But if I need the Logger
part of the public API for Kotlin platforms, then do I need to add it explicitly as api
in each of those targets?~
val androidMain by getting {
dependencies {
api("co.touchlab:kermit:2.0.0-RC5")
}
}
Ah, looks like it's just the explicit export that's necessary, which adds the overloads as extension functions:
cocoapods {
framework {
export("co.touchlab:kermit-simple:2.0.0-RC5")
}
}
It can still be an api
dependency in commonMain
. 👍
This is working exporting kermit-simple
.
When using a
Logger
class from Swift (and likely other non-Kotlin and non-Java languages, where Kotlin default arguments are not supported and@JvmOverloads
doesn't apply), it's not possible to call any of theLogger
functions that take default arguments without explicitly providing thetag
andthrowable
arguments. This used to be possible before #328 introduced these default arguments. It would be preferable to explicitly provide these function overloads, rather than relying on Kotlin's default arguments, which currently lack multiplatform support.