https://kotlinlang.org logo
#random
Title
s

sreich

04/08/2017, 3:11 PM
java logging confuses the crap out of me. so many libs and apis it's a bit of a mess
👍 3
e

elect

04/08/2017, 3:35 PM
you mean it's fun 🧌
b

bmsantos

04/08/2017, 6:30 PM
Wait until u get into JS world...
🧌 4
I always default to slf4j and log4j2 (async logging).
c

codeslubber

04/08/2017, 6:40 PM
it’s a dumpster fire, and a laughable case in point of how poorly choices were offered, logging, other logging, then logging compatibility…
b

bmsantos

04/08/2017, 8:10 PM
Common guys, it isn't that bad considering the years that Java already has on its shoulders.
c

codeslubber

04/08/2017, 9:24 PM
assume you are joking Bruno.. I have been using KotlinLogging lately, I like that thing...
s

sreich

04/08/2017, 9:37 PM
yeah kotlin-logging seems nice thus far
b

bmsantos

04/08/2017, 11:38 PM
Not joking. But haven't used Kotlin-logging yet. I'm sure it is an improvement over other frameworks. In time, things end up being replaced with something better, hopefully.
Apparently, Kotlin-logging is built on the top of slf4j.
Because it is a wrapper around slf4j, I'm assuming that if you use Kotlin-logging one still needs to add a specific slf4j bridge like log4j, log4j2, Java logging, logback, etc
Or do they provide their own?
c

codeslubber

04/09/2017, 12:02 AM
no you are right
and that was a hassle I thought, astounding to me that there were not simple docs for adding it to a gradle-based build
but once I got it working, I do like the kotlin sugary-ness of being able to use $s and the fact that there is no work to only output if log enabled (what logback brought)..
👍 1
s

sreich

04/09/2017, 12:04 AM
Yeah, agreed. I had to do this just now, went with log4j.
c

codeslubber

04/09/2017, 12:04 AM
I still find logging immensely useful
running unit tests all the time over and over
if I don’t know why something failed
I add a log message and rerun
for the pain of logging in J/K, at least we have good loggers, when writing Swift, you are still stuck with NSLog which is a complete joke
not really any better than a print statement
b

bmsantos

04/09/2017, 12:58 AM
@sreich, if you intend to use threading or use an async toolkit/framework, make sure you use log4j2 or any other logger that supports async logging otherwise you might block your threads. I default to log4j2 because of this.
s

sreich

04/09/2017, 12:58 AM
oh shit
@bmsantos i use compile "org.slf4jslf4j log4j121.7.25"
@sreich, nice game. Love Terraria. Will have to give it a try :)
s

sreich

04/09/2017, 1:53 AM
thanks 🙂 don't expect gameplay right now, it's just a tech demo state atm
👍 1
thanks for the logging stuff, good thing you mentioned something, i was going with slf4j and log4j1.2...got it working withh your example now
👍 1
7 Views