Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Logger: use isDebugEnabled/isTraceEnabled or just log?

 
olze oli
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have some code which uses logback for logging. I read somewhere that its better to use



instead of only:


I am wondering if this is true, because it blows the code to a much bigger size, which makes it more unreadable.

I can assume that its better to use LOG.isTraceEnabled() when using stuff like String.format(), but is this true also for regular LOG.trace() calls?
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I'm aware ;-) your correct and only useful for string formatting etc which isn't involved in this case.
 
I like tacos! And this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!