package net.darkmist.alib.exception;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class LoggingExceptionHandler implements ExceptionHandler
{
	private static final Class CLASS = LoggingExceptionHandler.class;
	private static final String CLASS_NAME = CLASS.getName();
	private static final Log logger = LogFactory.getLog(CLASS);

	private Log log;

	protected void setLogger(Log log_)
	{
		log = log_;
	}

	protected Log getLogger()
	{
		return log;
	}

	public LoggingExceptionHandler(Log log_)
	{
		setLogger(log_);
	}

	public void handleException(Throwable t)
	{
		log.error(t);
	}
}

@@ -117,16 +117,82 @@
 ctory;%0A%0A
+/**%0A * %7B@link ExceptionHandler%7D that just logs the exception.%0A */%0A
 public c
@@ -451,239 +451,715 @@
 ate 
-Log log;%0A%0A%09protected void setLogger(Log log_)%0A%09%7B%0A%09%09log = log_;%0A%09%7D%0A%0A%09protected Log getLogger()%0A%09%7B%0A%09%09return log;%0A%09%7D%0A%0A%09public LoggingExceptionHandler(Log log_)%0A%09%7B%0A%09%09setLogger(log_);%0A%09%7D%0A%0A%09public void handleException(Throwable t)%0A%09%7B%0A%09%09l
+volatile Log log = null;%0A%0A%09/**%0A%09 * Set the Log to log exceptions to.%0A%09 * @param log_ the log to log exceptions to.%0A%09 */%0A%09// final as constructor calls this.%0A%09public final void setLogger(Log log_)%0A%09%7B%0A%09%09log = log_;%0A%09%7D%0A%0A%09/**%0A%09 * Get the current logger.%0A%09 * @return The current logger.%0A%09 */%0A%09public Log getLogger()%0A%09%7B%0A%09%09return log;%0A%09%7D%0A%0A%09/**%0A%09 * Create using the given logger.%0A%09 * @param log_ The logger to use.%0A%09 */%0A%09public LoggingExceptionHandler(Log log_)%0A%09%7B%0A%09%09setLogger(log_);%0A%09%7D%0A%0A%09/**%0A%09 * Create using the logger for this class.%0A%09 */%0A%09 public LoggingExceptionHandler()%0A%09 %7B%0A%09 %7D%0A%0A%09public void handleException(Throwable t)%0A%09%7B%0A%09%09Log localLog;%0A%0A%09%09if((localLog = getLogger())==null)%0A%09%09%09localLog = logger;%0A%09%09localL
 og.e

fix ups to handle null loggers and such