Closed cosminstefanxp closed 5 years ago
Hi @cosminstefanxp, thanks for the report.
Could you use something like that?
Logging {
logger = object : Logger {
override fun log(message: String) {
Log.v(TAG, message)
}
}
}
Hmmm.. I'm slightly confused. Where would that go in a multiplatform project? Just in the Android project?
Yes, in Android. You also could add the expect class in common:
expect class MyAwesomeLogger : Logger
and add actual implementation for each platform:
actual class MyAwesomeLogger : Logger { ... }
Closed for now. Please reopen if the problem still exists.
Ktor Version
1.1.4
JVM Version, Operating System and Relevant Context
Android
Feedback
Currently, ktor-client-logging works on
jvm
using anslf4j
implementation. It would be great if there would be support for logging usingLog
on theandroid
platform. We've tried to make an actual implementation in our code base for theLogger.Companion.DEFAULT
, but the compiler doesn't allow us as it seems it can't find theexpected
.https://github.com/ktorio/ktor/blob/aee7373fb280b605e6486adabd397034a93aa30a/ktor-client/ktor-client-features/ktor-client-logging/jvm/src/io/ktor/client/features/logging/LoggerJvm.kt