CommonsLoggerpublic class CommonsLogger extends POILogger A logger class that strives to make it as easy as possible for
developers to write log calls, while simultaneously making those
calls as cheap as possible by performing lazy evaluation of the log
message. |
Fields Summary |
---|
private static LogFactory | _creator | private Log | log |
Methods Summary |
---|
public boolean | check(int level)Check if a logger is enabled to log at the specified level
if(level==FATAL)
{
if(log.isFatalEnabled())
{
return true;
}
}
else if(level==ERROR)
{
if(log.isErrorEnabled())
{
return true;
}
}
else if(level==WARN)
{
if(log.isWarnEnabled())
{
return true;
}
}
else if(level==INFO)
{
if(log.isInfoEnabled())
{
return true;
}
}
else if(level==DEBUG)
{
if(log.isDebugEnabled())
{
return true;
}
}
return false;
| public void | initialize(java.lang.String cat)
this.log = _creator.getInstance(cat);
| public void | log(int level, java.lang.Object obj1)Log a message
if(level==FATAL)
{
if(log.isFatalEnabled())
{
log.fatal(obj1);
}
}
else if(level==ERROR)
{
if(log.isErrorEnabled())
{
log.error(obj1);
}
}
else if(level==WARN)
{
if(log.isWarnEnabled())
{
log.warn(obj1);
}
}
else if(level==INFO)
{
if(log.isInfoEnabled())
{
log.info(obj1);
}
}
else if(level==DEBUG)
{
if(log.isDebugEnabled())
{
log.debug(obj1);
}
}
else
{
if(log.isTraceEnabled())
{
log.trace(obj1);
}
}
|
|