使用方法:
例如,
protected final Log logger = LogFactory.getLog(getClass());
if (logger.isDebugEnabled()) {
logger.debug("Servlet '" + getServletName() + "' configured successfully");
}
注意:如果没有加if判断,那么如果没有开启debug的情况下,他就会不断地创建string,而且我们外部是无法察觉,这样的话将会对性能有所影响