Community
Participate
Working Groups
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.