Is it possible to use `com.github.tony19:logback-a...
# kotlin-logging
b
Is it possible to use
com.github.tony19:logback-android
with version 4?
And if not? How do I set logging level for packages?
o
IIUC it should be possible, but not with the android module (with the jvm module kotlin-logging-jvm)
b
And how should I do that in a multiplatform project with many common code? See also https://kotlinlang.slack.com/archives/C3PQML5NU/p1688058646157229
o
I don't know a way that's possible to do. In that case I would defer to the android log. Do you know what is the advantage of
logback-android
over native android
Log
?
b
I could not find a working way, to configure android native Log. Since the upgrade I only get ERROR logs, but I need some packages with DEBUG log until they are stable enough. This can be easily configured via logback...
o
I can add support for that in android module itself (to pick between the two)
b
That would be really awesome. Currently I have the problem, that I upgraded kotlin-logging in a published library, but one of my project uses this library and Android has no logs anymore.
o
do you think this is something that you can add to the app?
like
System.setProperty("kotlin-logging-to-logback-android", "true")
b
That should be possible, but it should be
kotlin-logging-to-slf4j
. Personally I think it would be better to have slf4j as default, because it was the default in older kotlin-logging versions and is also the more usual one in the Android world.
o
sure
can you open an issue in the repo please?
b
See also the table in the top of https://source.android.com/docs/core/tests/debug/understanding-logging?hl=en
android.util.Log
is more for Android framework and system application
o
I am actually quite surprise because I didn't see popular frameworks with slf4j in the past in android
For example, timber is pretty popular and it uses Log: https://github.com/JakeWharton/timber
so what should be the default itself is something we should check more, but let's start with fixing the issue
o
I think I will start with the default as you suggested, but it might change in the future
b
Thank you very much!