So i am looking for a logging library, or code sni...
# random
So i am looking for a logging library, or code snippet that can automatically add linenumbers to logmessages, using reflection or so is fine too does anyone know how one can manage something like that with kotlin-logging or any other logging framework ?
You can use logback as
backend. Proceed with to achieve desired output (i.e.
is what you want I guess). To make it even better, you can add
somewhere in formatted line, then you'll be able to navigate to logged line from the console.
you can do this with with log4j loggingevent has a locationIformation property which has lineNumber. its worth spending a few hours to digest to logging hell of java. log4j support the SLF4J so it plugs into dependencies like Koin etc easily. I played with the idea of my own simply logging library but at some point you have to face the java devil and you'll end up implementing a slf4j adapter for your own logging library anyway so its non-escpable. there's not much boilerplate to log4j - beyond basic init and only thing I've done is create a JsonLayout for stackdriver