Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preprocessor logging statements in java

for example I want to replace before compilation:

#debug("${enclosing_method} this is debug message for " + userName)

with:

if (log.isDebugEnabled())
{
  log.debug("<real method name> this is debug message for " + userName);
}
like image 842
oshai Avatar asked Oct 14 '10 22:10

oshai


1 Answers

Don't. Use slf4j instead which allows you to avoid the check with {}.

like image 143
Thorbjørn Ravn Andersen Avatar answered Oct 30 '22 20:10

Thorbjørn Ravn Andersen