Hey guys, is there any multiplatform logging libra...
# multiplatform
j
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
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
I forgot about that. I could get back into that if helpful
j
I've just been plate spinning too many things. There's nothing blocking it except the effort.
i
it doesn't have a k/n impl but one of my friends wrote his own and it works for him ¯\_(ツ)_/¯
j
That README just makes me hate Timber's API
i
I guess I'll take that as a compliment 🧌
j
Just a reminder that puns should stop at the name and not leak into the API
🎉 2
2
i
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
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
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
👈 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
https://github.com/AAkira/Napier There is a library called Napier
r
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
Thanks guys. It would be great to see multiplatform Timber in the near future, but for now Napier seems like the best option
k
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
This week going to work on it. Will ping you when I do
k
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
@jw Is there any progress on this?