When using slf4j (or other) loggers, do you use :o...
# codereview
m
When using slf4j (or other) loggers, do you use 1️⃣ string interpolation -
<http://logger.info|logger.info>("the value is $value")
2️⃣ passing additional arguments -
<http://logger.info|logger.info>("the value is {}", value)
3️⃣ 🧵 something else?
2️⃣ 5
a
"... {}"
for logs that need to be removed by R8
m
2️⃣ is the intended way, it guarantees that the message won’t be interpolated if the corresponding level is not active
c
kotlin logging:
logger.debug { "hello $message" }
imo even better than 2
👍 1
a
logger.debug { "hello $message" }
I'm not sure what ☝️ is, something you defined on your own?
d
#kotlin-logging
It's a library
👍 2
j
Have you considered using structured logging, then no string interpolation is required...