// Path: src/main/java/com/j256/simplemagic/logger/Level.java
// public enum Level {
// 	/** for tracing messages that are very verbose, such as the protocol level */
// 	TRACE(1),
// 	/** messages suitable for debugging purposes */
// 	DEBUG(2),
// 	/** information messages */
// 	INFO(3),
// 	/** warning messages */
// 	WARNING(4),
// 	/** error messages */
// 	ERROR(5),
// 	/** severe fatal messages */
// 	FATAL(6),
// 	/** for turning off all log messages */
// 	OFF(7),
// 	// end
// 	;
// 
// 	private final int value;
// 
// 	private Level(int value) {
// 		this.value = value;
// 	}
// 
// 	/**
// 	 * Return whether or not a level argument is enabled for this level value. So,
// 	 * {@code Level.INFO.isEnabled(Level.WARN)} returns true because if INFO level is enabled, WARN messages are
// 	 * displayed but {@code Level.INFO.isEnabled(Level.DEBUG)} returns false because if INFO level is enabled, DEBUG
// 	 * messages are not displayed. If this or the other level is OFF then false is returned.
// 	 */
// 	public boolean isEnabled(Level otherLevel) {
// 		return (this != Level.OFF && otherLevel != Level.OFF && value <= otherLevel.value);
// 	}
// }
// 
// Path: src/main/java/com/j256/simplemagic/logger/LogBackend.java
// public interface LogBackend {
// 
// 	/**
// 	 * Returns true if the log level argument is enabled meaning that the log messages should be shown.
// 	 */
// 	public boolean isLevelEnabled(Level level);
// 
// 	/**
// 	 * Log a message.
// 	 */
// 	public void log(Level level, String message);
// 
// 	/**
// 	 * Log a message with a throwable which is guaranteed to not be null.
// 	 */
// 	public void log(Level level, String message, Throwable throwable);
// }
// 
// Path: src/main/java/com/j256/simplemagic/logger/LogBackendFactory.java
// public interface LogBackendFactory {
// 
// 	/**
// 	 * Create a log backend implementation from the class-label.
// 	 */
// 	public LogBackend createLogBackend(String classLabel);
// }


import com.j256.simplemagic.logger.Level;
import com.j256.simplemagic.logger.LogBackend;
import com.j256.simplemagic.logger.LogBackendFactory;
package com.j256.simplemagic.logger.backend;


/**
 * Log backend that delegating to the Apache commons logging classes.
 * 
 * From SimpleLogging: https://github.com/j256/simplelogging
 *
 * @author graywatson
 */
public class CommonsLoggingLogBackend implements LogBackend {

	private final org.apache.commons.logging.Log log;

	public CommonsLoggingLogBackend(String className) {
		this.log = org.apache.commons.logging.LogFactory.getLog(className);
	}

	@Override
	public boolean isLevelEnabled(Level level) {
		switch (level) {
			case TRACE:
				return log.isTraceEnabled();
			case DEBUG:
				return log.isDebugEnabled();
			/* INFO below */
			case WARNING:
				return log.isWarnEnabled();
			case ERROR:
				return log.isErrorEnabled();
			case FATAL:
				return log.isFatalEnabled();
			case INFO:
			default:
				return log.isInfoEnabled();
		}
	}

	@Override
	public void log(Level level, String msg) {
		switch (level) {
			case TRACE:
				log.trace(msg);
				break;
			case DEBUG:
				log.debug(msg);
				break;
			/* INFO below */
			case WARNING:
				log.warn(msg);
				break;
			case ERROR:
				log.error(msg);
				break;
			case FATAL:
				log.fatal(msg);
				break;
			case INFO:
			default:
				log.info(msg);
				break;
		}
	}

	@Override
// Path: src/main/java/com/j256/simplemagic/logger/Level.java
// public enum Level {
// 	/** for tracing messages that are very verbose, such as the protocol level */
// 	TRACE(1),
// 	/** messages suitable for debugging purposes */
// 	DEBUG(2),
// 	/** information messages */
// 	INFO(3),
// 	/** warning messages */
// 	WARNING(4),
// 	/** error messages */
// 	ERROR(5),
// 	/** severe fatal messages */
// 	FATAL(6),
// 	/** for turning off all log messages */
// 	OFF(7),
// 	// end
// 	;
// 
// 	private final int value;
// 
// 	private Level(int value) {
// 		this.value = value;
// 	}
// 
// 	/**
// 	 * Return whether or not a level argument is enabled for this level value. So,
// 	 * {@code Level.INFO.isEnabled(Level.WARN)} returns true because if INFO level is enabled, WARN messages are
// 	 * displayed but {@code Level.INFO.isEnabled(Level.DEBUG)} returns false because if INFO level is enabled, DEBUG
// 	 * messages are not displayed. If this or the other level is OFF then false is returned.
// 	 */
// 	public boolean isEnabled(Level otherLevel) {
// 		return (this != Level.OFF && otherLevel != Level.OFF && value <= otherLevel.value);
// 	}
// }
// 
// Path: src/main/java/com/j256/simplemagic/logger/LogBackend.java
// public interface LogBackend {
// 
// 	/**
// 	 * Returns true if the log level argument is enabled meaning that the log messages should be shown.
// 	 */
// 	public boolean isLevelEnabled(Level level);
// 
// 	/**
// 	 * Log a message.
// 	 */
// 	public void log(Level level, String message);
// 
// 	/**
// 	 * Log a message with a throwable which is guaranteed to not be null.
// 	 */
// 	public void log(Level level, String message, Throwable throwable);
// }
// 
// Path: src/main/java/com/j256/simplemagic/logger/LogBackendFactory.java
// public interface LogBackendFactory {
// 
// 	/**
// 	 * Create a log backend implementation from the class-label.
// 	 */
// 	public LogBackend createLogBackend(String classLabel);
// }


// Path: src/main/java/com/j256/simplemagic/logger/backend/CommonsLoggingLogBackend.java
import com.j256.simplemagic.logger.Level;
import com.j256.simplemagic.logger.LogBackend;
import com.j256.simplemagic.logger.LogBackendFactory;

package com.j256.simplemagic.logger.backend;


/**
 * Log backend that delegating to the Apache commons logging classes.
 * 
 * From SimpleLogging: https://github.com/j256/simplelogging
 *
 * @author graywatson
 */
public class CommonsLoggingLogBackend implements LogBackend {

	private final org.apache.commons.logging.Log log;

	public CommonsLoggingLogBackend(String className) {
		this.log = org.apache.commons.logging.LogFactory.getLog(className);
	}

	@Override
	public boolean isLevelEnabled(Level level) {
		switch (level) {
			case TRACE:
				return log.isTraceEnabled();
			case DEBUG:
				return log.isDebugEnabled();
			/* INFO below */
			case WARNING:
				return log.isWarnEnabled();
			case ERROR:
				return log.isErrorEnabled();
			case FATAL:
				return log.isFatalEnabled();
			case INFO:
			default:
				return log.isInfoEnabled();
		}
	}

	@Override
	public void log(Level level, String msg) {
		switch (level) {
			case TRACE:
				log.trace(msg);
				break;
			case DEBUG:
				log.debug(msg);
				break;
			/* INFO below */
			case WARNING:
				log.warn(msg);
				break;
			case ERROR:
				log.error(msg);
				break;
			case FATAL:
				log.fatal(msg);
				break;
			case INFO:
			default:
				log.info(msg);
				break;
		}
	}

	@Override
	public void log(Level level, String msg, Throwable t) {