package CoreFS.SD03;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;


public class CoreLog4JLogger
    implements CoreFileLog
{

    public CoreLog4JLogger()
    {
    }

    public CoreLog4JLogger(String s)
    {
        log4jLogger = Logger.getLogger(s);
    }

    public CoreLog4JLogger(Logger logger)
    {
        log4jLogger = logger;
    }

    public boolean isDebugEnabled()
    {
        return log4jLogger.isDebugEnabled();
    }

    public boolean isInfoEnabled()
    {
        return log4jLogger.isInfoEnabled();
    }

    public boolean isWarnEnabled()
    {
        return log4jLogger.isEnabledFor(Level.WARN);
    }

    public boolean isErrorEnabled()
    {
        return log4jLogger.isEnabledFor(Level.ERROR);
    }

    public boolean isFatalEnabled()
    {
        return log4jLogger.isEnabledFor(Level.FATAL);
    }

    public void logDebug(Object obj)
    {
        log4jLogger.log(b, Level.DEBUG, obj, null);
    }

    public void logDebug(Object obj, Throwable throwable)
    {
        log4jLogger.log(b, Level.DEBUG, obj, throwable);
    }

    public void logInfo(Object obj)
    {
        log4jLogger.log(b, Level.INFO, obj, null);
    }

    public void logInfo(Object obj, Throwable throwable)
    {
        log4jLogger.log(b, Level.INFO, obj, throwable);
    }

    public void logWarn(Object obj)
    {
        log4jLogger.log(b, Level.WARN, obj, null);
    }

    public void logWarn(Object obj, Throwable throwable)
    {
        log4jLogger.log(b, Level.WARN, obj, throwable);
    }

    public void logFatal(Object obj)
    {
        log4jLogger.log(b, Level.FATAL, obj, null);
    }

    public void logFatal(Object obj, Throwable throwable)
    {
        log4jLogger.log(b, Level.FATAL, obj, throwable);
    }

    public void logError(Object obj)
    {
        log4jLogger.log(b, Level.ERROR, obj, null);
    }

    public void logError(Object obj, Throwable throwable)
    {
        log4jLogger.log(b, Level.ERROR, obj, throwable);
    }

    public String getName()
    {
        return log4jLogger.getName();
    }

    private static final String b;
    protected Logger log4jLogger;

    static 
    {
        b = CoreLog4JLogger.class.getName();
    }

	public String getFileLogInfo(String path) {
		// TODO Auto-generated method stub
		return null;
	}
}