https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
i

Ivann Ruiz

09/03/2020, 6:18 PM
Suggestions for logging in KMM apps? mostly interested in Android/iOS
c

Casey Brooks

09/03/2020, 6:20 PM
I’ve just pushed Clog to Bintray. Designed to work out-of-the-box with no config required https://github.com/copper-leaf/clog
💯 1
i

Ivann Ruiz

09/03/2020, 6:21 PM
Great, will check it out!
k

Konstantin Tskhovrebov

09/03/2020, 7:05 PM
I use https://github.com/AAkira/Napier in mi pet projects
👍 1
i

Ivann Ruiz

09/09/2020, 5:19 PM
@Casey Brooks Hey i'm trying to use Clog but gradle can't seem to find the dependency on bintray, I C/P this line from github for my KMP project
implementation("clog:core:{{site.version}}")
in
commonMain
sourceset and tried replacing
{{site.version}}
with the latest version
3.5.4
but it wasn't found. It only seems to find something using
"io.copper-leaf:clog:3.5.4"
but then the iOS breaks. Any insights would be appreciated
c

Casey Brooks

09/09/2020, 5:24 PM
I don’t have it released to JCenter just yet, so you’ll need to add the local Bintray repo for it
Copy code
repositories {
    ...
    maven(url = "<https://dl.bintray.com/copper-leaf/oss>")
}
i

Ivann Ruiz

09/09/2020, 5:39 PM
Forgot to mention that I added that maven repo as well, it's still not working though.
c

Casey Brooks

09/09/2020, 6:22 PM
Hmm, I just tried it again in the MPP library I’m creating this for, and it compiled to an iOS framework just fine. Is it not finding the iOS dependency, or it is having an error at runtime?
i

Ivann Ruiz

09/09/2020, 6:32 PM
• This doesn't work at all
implementation("clog:core:3.5.4")
(that's the KMP instruction from github) • This kind of works
implementation("io.copper-leaf:clog:3.5.4")
it will throw errors in the IDE but compile for Android. iOS fails with this message:
Copy code
e: Could not find "/Users/ivannruiz/.gradle/caches/modules-2/files-2.1/io.copper-leaf/clog-iosx64/3.5.4/ed83b2ca17d07aa4e3db451a40e6d87de2caf8b3/clog.klib" in [/Users/ivannruiz/wormy-mobile/mobile/ios/Pods, /Users/ivannruiz/.konan/klib, /Users/ivannruiz/.konan/kotlin-native-prebuilt-macos-1.4/klib/common, /Users/ivannruiz/.konan/kotlin-native-prebuilt-macos-1.4/klib/platform/ios_x64].
c

Casey Brooks

09/09/2020, 6:43 PM
yeah, I’m still figuring how how exactly to publish it.
implementation("clog:core:3.5.4")
was my first try in publishing it but Bintray didn’t like the groupId, so I changed it to
implementation("io.copper-leaf:clog:3.5.4")
. It looks like I updated the JVM usage in the readme but not the MPP one, so thanks for pointing that out.
implementation("io.copper-leaf:clog:3.5.4")
is the proper dependency. Also, it looks like you’re using Kotlin 1.4? That might be causing that problem as well, I haven’t tried updating to it yet. I honestly don’t know what’s expected when using a 1.3.72 lib in 1.4
👍 1
i

Ivann Ruiz

09/09/2020, 6:52 PM
Ah yeah I'm using K 1.4... that might have something to do with it
Guess I'll have to find another logger for the time being but would def like to see Clog in K1.4!
k

Konstantin Tskhovrebov

09/09/2020, 7:15 PM
Napier… 😌
👍 1
i

Ivann Ruiz

09/09/2020, 7:20 PM
@Konstantin Tskhovrebov Currently giving Napier a try! so far so good
15 Views