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

Jan Stoltman

07/19/2019, 12:10 AM
Hey guys, is there any multiplatform logging library for Android/iOS out there? @kpgalligan has mentioned that he has a K/N version of Timber in his droidcon SF 2018 talk iirc, is it out somewhere?
j

jw

07/19/2019, 12:11 AM
I kinda got lazy and didn't finish
I have a million and one things in flight...
It's possible I can be convinced to try and finish it for my Droidcon NYC talk
k

kpgalligan

07/19/2019, 12:16 AM
I forgot about that. I could get back into that if helpful
j

jw

07/19/2019, 12:17 AM
I've just been plate spinning too many things. There's nothing blocking it except the effort.
i

ian.shaun.thomas

07/19/2019, 12:19 AM
it doesn't have a k/n impl but one of my friends wrote his own and it works for him ¯\_(ツ)_/¯
j

jw

07/19/2019, 12:21 AM
That README just makes me hate Timber's API
i

ian.shaun.thomas

07/19/2019, 12:21 AM
I guess I'll take that as a compliment 🧌
j

jw

07/19/2019, 12:22 AM
Just a reminder that puns should stop at the name and not leak into the API
🎉 2
2
i

ian.shaun.thomas

07/19/2019, 12:23 AM
ehhh I didn't want people to really switch to this from timber as then I would actually have to support the lib past my own use cases.. I'm happy to continue letting you work for free
j

jw

07/19/2019, 12:24 AM
well contributions are very welcome once i land the infrastructure bits
actually i can justify this as part of my day job so i'll get started tomorrow
👍 4
i

ian.shaun.thomas

07/19/2019, 12:25 AM
indeed, based on your commentary around the around log limits I believe I wrote a concise way to properly split the messages. If you're happy with it I'm happy to push it to Timber when you're ready (or you can just copy/pasta, fine with me) https://github.com/ToxicBakery/Arbor/blob/master/common/android/src/androidMain/kotlin/com/toxicbakery/logging/LogCatSeedling.kt#L123 It tries to split at line limits but it also attempts to leverage line breaks which may or may not be a good thing.
j

Jared Woolston

07/19/2019, 12:29 AM
👈 I have the native implementation @ian.shaun.thomas is referring to. The only reason I have not contributed it anywhere is, in my use case, its in C and I have yet to see a method to share that bit as part of a kotlin native klib though I will freely admit that could be nothing more than a misunderstanding of the documentation on my part.
I use JNI to access the kotlin methods to bring all my native logging up to the host application.
y

yshrsmz

07/19/2019, 12:47 AM
https://github.com/AAkira/Napier There is a library called Napier
r

russhwolf

07/19/2019, 2:14 AM
I haven’t tried any of them but in addition to Napier there’s a couple other multiplatform loggers listed at https://github.com/AAkira/Kotlin-Multiplatform-Libraries#logging
j

Jan Stoltman

07/19/2019, 10:29 AM
Thanks guys. It would be great to see multiplatform Timber in the near future, but for now Napier seems like the best option
k

kpgalligan

07/21/2019, 11:54 PM
I went back and updated my earlier fork of timber to work on Kotlin 1.3.41. I would probably code native differently now, and if/when state changes happen it’ll probably change again, but here’s code: https://github.com/touchlab/timber/tree/native , and published builds: https://search.maven.org/search?q=co.touchlab%20timber. Assume this will change as Jake spins Timber’s plate in the future, but if you simply must have Timber now…
That library list is super old, BTW. I took a sample of several, a bunch are from one dev, and last commits were like 8 months ago. I’ve had a library list too, which got super old. Somebody must be keeping a better list of “everything” somewhere, at least until “everything” is difficult to track
j

jw

07/22/2019, 12:04 AM
This week going to work on it. Will ping you when I do
k

kpgalligan

07/22/2019, 12:17 AM
OK. Let me know. Have to dig a bit on iOS logging. I went super basic on the first round (just “NSLog”). I’d also like to support linux/windows, assuming that’s feasible, but I have no idea what api’s are used to log on those platforms. Probably not super hard to sort out, but maybe somebody’s got a link?
j

Jan Stoltman

08/06/2019, 6:48 AM
@jw Is there any progress on this?
7 Views