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

AmrJyniat

03/10/2023, 9:28 AM
I noticed that Napier logging library log/print the one line twice, is anyone faced the same problem or I'm missing something?
d

darkmoon_uk

03/10/2023, 9:45 AM
I don't remember the solution but I do remember having this problem in Napier and it being expected behaviour... checking...
You basically have to follow that code example with respect to the line:
Copy code
antilogLogger.useParentHandlers = false
...to achieve what most would consider "default behaviour". Not blaming Napier, but it's a little obtuse.
a

AmrJyniat

03/10/2023, 9:57 AM
I ended up with this:
Copy code
Napier.base(DebugAntilog())
val antilogLogger = Logger.getLogger(DebugAntilog::class.java.name)
antilogLogger.useParentHandlers = false
And It's still log twice
d

darkmoon_uk

03/10/2023, 9:59 AM
Also I don't follow their naming of 'AntiLog', what does that even mean? I want the right amount of logging. Not anti, not twice, just log my lines once. Other technologies have been getting this right since the seventies... And that's probably doing the sixties a disservice.
You know what, forget the equivocation, sort it out Napier.
I recommend Kermit
Multiplatform logging from TouchLab, it 'just works'
a

AmrJyniat

03/10/2023, 10:02 AM
Ok, I'll give it a try, Thanks!
Hi Chris, the suggested library was pretty good, but I wonder if I can log via it from the swift side?
12 Views