kotlin-logging
                                
                                 kotlin-logging copied to clipboard
                                
                                    kotlin-logging copied to clipboard
                            
                            
                            
                        Not work on Android
implementation 'io.github.microutils:kotlin-logging:2.0.11' implementation 'org.slf4j:slf4j-simple:1.7.36' implementation 'org.slf4j:slf4j-api:1.7.36'
With these library i can't see any log using Android
val klog = KotlinLogging.logger{}
Thank you for reporting an issue. See the wiki for documentation and slack for questions.
Try using the dependency io.github.microutils:kotlin-logging-jvm instead of the first one (note the jvm at the beginning).
And you should also use slf4j-android and not slf4j-simple probably.
Same, not work with slf4j-android and kotlin-logging-jvm
There is this example which was working in the past (but it uses the old kotlin-logging 1.x): https://github.com/MicroUtils/kotlin-logging-example-android
You can try that or spot the differences or create a newer repo to reproduce the issue.
i've already use this example but it still not work. the combination of libraries from that example does not work
I am using it all the time on desktop and Android and it works. For Android just use the dependencies:
implementation("io.github.microutils:kotlin-logging-jvm:2.1.23")
implementation("org.slf4j:slf4j-android:1.7.35")
Not work
at this point it makes me think that I am doing something else wrong besides the dependencies
i declared a global variable in a file called KLogger.Kt like this:
val klog = KotlinLogging.logger {  }
This is not the intended usage. First try to follow the examples before you make your own experiments.
not the correct use?? tell me what changes at runtime my example from the one shown at the link https://github.com/MicroUtils/kotlin-logging-example-android/blob/master/app/src/main/java/mu/kotlinloggingexampleandroid/MainActivity.kt . And anyway using the examples shown on the page doesn't work.
were you able to resolve the issue or still need assistance?
here it is suggested to use slf4j-handroid.
我一直在台式机和Android上使用它,并且可以正常工作。 对于Android,只需要使用依赖项:
implementation("io.github.microutils:kotlin-logging-jvm:2.1.23") implementation("org.slf4j:slf4j-android:1.7.35")
Thanks, I can print out the log with yours
This is my previous configuration and can't print logs at all
 // implementation 'org.slf4j:slf4j-android:1.7.36' //implementation 'io.github.microutils:kotlin-logging-jvm:3.0.2'
kotlin logging 3 is not compatible with slf4j 1.7. it seems that slf4j-android doesn't have 2.x versions so I suspect it's not working anymore. Try to find another implementation for slf4j 2 for android.
See updates on #122 on how I plan to solve the issue.
Version 4.0.0-beta-15 contains native android logging with artifact kotlin-logging-android.