AAkira / Napier

Logging library for Kotlin Multiplatform
Apache License 2.0
786 stars 34 forks source link

How to remove W/System.err: Aug 21, 2020 4:33:38 PM com.github.aakira.napier.DebugAntilog performLog #48

Closed schmidt9 closed 4 years ago

schmidt9 commented 4 years ago

Hello How to remove repeating message in Console and LogCat in Android Studio?

W/System.err: Aug 21, 2020 4:33:38 PM com.github.aakira.napier.DebugAntilog performLog

AAkira commented 4 years ago

I'm sorry. I couldn't reproduce it in my environment.

Do you have example code or repository? I'll check it.

schmidt9 commented 4 years ago

I tried to debug it a little and I get this message after executing selected line, I suppose this comes from logger.fine call Снимок экрана 2020-08-21 в 20 32 47

Napier.d("TEST")

I get this messages in LogCat

W/System.err: Aug 21, 2020 8:36:30 PM com.github.aakira.napier.DebugAntilog performLog W/System.err: FINE: [DEBUG] Napier$d$default - TEST

schmidt9 commented 4 years ago

I suppose it might be something with Logger setup in your framework? I did nothing in this direction on my side https://stackoverflow.com/questions/6315699/why-are-the-level-fine-logging-messages-not-showing

AAkira commented 4 years ago

I see. I think it is for JVM.

Do you write the implementation "com.github.aakira:napier-android:1.4.0 in the Android module? I think you use DebugAntilog for JVM.

AAkira commented 4 years ago

@schmidt9 How was this?

acousticksan commented 4 years ago

@schmidt9 add this lines to you android gradle file

    configurations.all {
        resolutionStrategy {
            exclude("com.github.aakira", "napier-jvm")
        }
    }
AAkira commented 4 years ago

Thanks. This is another solution.

schmidt9 commented 4 years ago

I see. I think it is for JVM.

Do you write the implementation "com.github.aakira:napier-android:1.4.0 in the Android module? I think you use DebugAntilog for JVM.

I have implementation "com.github.aakira:napier:$napierVersion" in commonMain only as you suggested in #47

schmidt9 commented 4 years ago

@schmidt9 add this lines to you android gradle file

    configurations.all {
        resolutionStrategy {
            exclude("com.github.aakira", "napier-jvm")
        }
    }

@AcoustickSan where should I add it properly? I have a gradle script with multiple targets, whenever I add your snippet at different places (at file root or inside androidMain) it gives me

Gradle DSL method not found: 'exclude()'
Possible causes:
The project 'KotlinNativeTest' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 4.0.1 and sync project

(while I've already got Gradle 4.0.1)

schmidt9 commented 4 years ago

I'm sorry. I couldn't reproduce it in my environment.

Do you have example code or repository? I'll check it.

BTW the same with performLog you have on this screenshot https://github.com/AAkira/Napier/blob/master/arts/screenshot-jvm.jpg

AAkira commented 4 years ago

@schmidt9

I published the Napier1.4.1-alpha1.

I have implementation "com.github.aakira:napier:$napierVersion" in commonMain only as you suggested in #47

You should write this implementation "com.github.aakira:napier:1.4.1-alpha1 in this line.

And maybe you don't need to write exclude codes. Please check it.

schmidt9 commented 4 years ago

@AAkira now it seems to be OK, performLog line gone