Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368920

Summary: JettyAwareLogger always formats the arguments
Product: [RT] Jetty Reporter: Simone Bordet <simone.bordet>
Component: otherAssignee: Simone Bordet <simone.bordet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 7.6.0.RC4   
Target Milestone: 7.5.x   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Simone Bordet CLA 2012-01-18 04:00:21 EST
JettyAwareLogger always formats the arguments passed in, resulting in unnecessary calls to toString() if the logger's level is greater than the method's logging level.
That is, even if the logger is enabled for INFO level, calling logger.debug("A format string {}", this) results in this.toString() being called.
Comment 1 Simone Bordet CLA 2012-01-18 04:10:00 EST
Fixed by adding a guard to JettyAwareLogger before formatting the message, that checks whether message log level is greater or equal than the logger's log level.