> From: Mike Stover [mailto:[EMAIL PROTECTED]] 
> 
> Ok, I will write a simple class to deal with logging.  I will 
> also make the logging level changeable 
> at run-time (I hate having to shut-down just to change the 
> logging configuration).  Then, 
> logging should be as simple as Log.log("whatever"); As it 
> should be for an application as 
> simple as JMeter.


Mike.  Use my LoggerManager idea.  It is as simple as this:

LoggerManager
{
    org.apache.avalon.logger.Logger getLoggerFor("category");
}

The thing is that the Log.log("...") is not granular enough.
I commonly want the ability to easily turn on and off whole
categories of information. That way I can zero in on the
information that is most helpful to me while I am debugging.

Also the Logger interface allows you to do things like this:

if ( m_logger.isDebugEnabled() )
{
    String msg = "This is a " + obj.getAdjective();
    msg += "expensive message to " + obj.getVerb();

    m_logger.debug( msg );
}


When we have long concatenations or StringBuffer.toString()
calls that are necessary in logging situations, we can get
out of performing those slow operations if we aren't even
logging that log level.

The category approach allows us to set some categories to
"ERROR" level while we have the ones we are debugging set
to "DEBUG" level.  It really helps reduce the amount of
output we have to wade through to get it working.

I can whip something up for you if you like.  It will take
a little bit of time, but its not that difficult.


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

Reply via email to