Switch to Slf4j
Issue #18
resolved
There are many (good) reasons to use Slf4j in place of Commons Logging:
- http://jayunit100.blogspot.fr/2013/10/simplifying-distinction-between-sl4j.html
- http://articles.qos.ch/classloader.html
For the time being, I can fortunately use jcl-over-slf4j
and overcome those issues as a side-effect.
Comments (3)
-
repo owner -
The reason I prefer SLF4J over Common logging is because the API of the former takes a format string whereas the latter takes the message as a String. So, with SLF4J, you have this nice code:
_logger.debug("Foo = {}, bar = {}", foo, bar);
In common logging, you have to have this:
_logger.debug(String.format("Foo = %s, bar = %d", foo, bar);
The common logging approach requires the call to
String.format
which also requires you to align the variable types and the markers in theformat
method. -
repo owner - changed status to resolved
this is done with 6c59e75 thanks largely to @jawi
- Log in to comment
Thanks for the suggestion @tbroyer. I'm vaguely aware of the opinions around SLF4J vs. Commons Logging. But having never really run into problems with Commons Logging (or slf4j) myself, I don't have strong feelings about it either way. I'll take a closer look though and consider a switch in future versions.