"David S. Faller" <[EMAIL PROTECTED]> writes:

> Hi everyone...
> 
> I have a question regarding the LoggingService:
> Has anybody thought about adding a get-method for the loglevel?
> 
> I am asking, because in performance critical environments problems might
> arise for debug messages.
> 
> Most debug statements look like this:
> Log.debug("myMethod() entered. param1="+param1+";param2="+param2);
> 
> In a production system, the log level is INFO or higher, so all string
> operations for the call are unnecessary.
> 
> What about something like:
> if (Log.getLogLevel() > Log.LEVEL_DEBUG) {
>     Log.debug("myMethod() entered. param1="+param1+";param2="+param2);
> }
> 
> This would reduce unnecessary operations and improve performance...

I'm in favor of this.  We've noted the same thing at CollabNet, and
often use per-class private boolean constants to achieve the same
effect.

Daniel Rall

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to