Bug 185512 - collapsable log statements
Summary: collapsable log statements
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-04 06:08 EDT by jeroen Mising name CLA
Modified: 2007-05-07 07:09 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jeroen Mising name CLA 2007-05-04 06:08:35 EDT
I'm currently in a debate with a collegue on logging. I'd love to see more logging statements in my code to be able to pinpoint errors and bugs faster just be cranking up the loglevel of a class or package. On the other hand the logging levels do clutter up your code and it makes it harder to view.
Wouldnt it be nice if the IDE can also show your logstatements depending of logattribute of the file. A bit the same as hiding your import statements but than dependent of an changeable loglevel attribute.

so lets say my code is full of logging stmts like this:

final String methodName = "getIndexSelectItems: ";
if (logger.isTraceEnabled()) {
    logger.trace(LogUtils.getLogMessage(BusinessLayerConstants.VERSION,
        methodName, "starting "));
}

or 
if (logger.isInfoEnabled()) {
    logger.info(LogUtils.getLogMessage(BusinessLayerConstants.VERSION,
        methodName, "info"));
}

or

logger.error(LogUtils.getLogMessage(BusinessLayerConstants.VERSION,
        methodName, "error"));

Setting the loglevel attribute in the IDE to trace would show all the above logging statements. Settting the loglevel attribute in the IDE to error would only show the last log statement.

For me it would mean a very welcome feature.
regards,
Jeroen.