Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368920 - JettyAwareLogger always formats the arguments
Summary: JettyAwareLogger always formats the arguments
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: other (show other bugs)
Version: 7.6.0.RC4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Simone Bordet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 04:00 EST by Simone Bordet CLA
Modified: 2012-01-18 04:10 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.