I didn't know that slf4j is another abstraction for
ex. log4j. Slf4j independence application from using ex. log4j or common
logs. It doesn't log anything if behind it there isn't any logging
library.
Slf4j gives something useful in its interface - something like string format. You can write
and then, when this class is at higher logging level then debug it doesn't concatenate string)LOGGER.debug("This my log in class {} and method {}", getName(), "my method");
I think it doesn't protect us from writing sometime like this:
if(LOGGER.isDebug()){
String s = someLongExecutionOperation();
LOGGER.debug(s);
}
No comments:
Post a Comment