package CoreFS.SD03;


import java.util.logging.Level;
import java.util.logging.Logger;

// Referenced classes of package com.posdata.glue.util.log:
//            PosLog

public class CoreJdk14Logger
    implements CoreFileLog
{

    public CoreJdk14Logger(String s)
    {
        jdk14Logger = null;
        jdk14Logger = Logger.getLogger(s);
    }

    public boolean isDebugEnabled()
    {
        return jdk14Logger.isLoggable(Level.FINE);
    }

    public boolean isInfoEnabled()
    {
        return jdk14Logger.isLoggable(Level.INFO);
    }

    public boolean isWarnEnabled()
    {
        return jdk14Logger.isLoggable(Level.WARNING);
    }

    public boolean isErrorEnabled()
    {
        return jdk14Logger.isLoggable(Level.SEVERE);
    }

    public boolean isFatalEnabled()
    {
        return jdk14Logger.isLoggable(Level.SEVERE);
    }

    public void logDebug(Object obj)
    {
        log(b, obj, null);
    }

    public void logDebug(Object obj, Throwable throwable)
    {
        log(b, obj, throwable);
    }

    public void logInfo(Object obj)
    {
        log(c, obj, null);
    }

    public void logInfo(Object obj, Throwable throwable)
    {
        log(c, obj, throwable);
    }

    public void logWarn(Object obj)
    {
        log(d, obj, null);
    }

    public void logWarn(Object obj, Throwable throwable)
    {
        log(d, obj, throwable);
    }

    public void logFatal(Object obj)
    {
        log(f, obj, null);
    }

    public void logFatal(Object obj, Throwable throwable)
    {
        log(f, obj, throwable);
    }

    public void logError(Object obj)
    {
        log(e, obj, null);
    }

    public void logError(Object obj, Throwable throwable)
    {
        log(e, obj, throwable);
    }

    private void log(Level level, Object obj, Throwable throwable)
    {
        if(jdk14Logger.isLoggable(level))
        {
            String s = "unknown";
            String s1 = "unknown";
            Throwable throwable1 = new Throwable();
            StackTraceElement astacktraceelement[] = throwable1.getStackTrace();
            if(astacktraceelement != null && astacktraceelement.length > 2)
            {
                StackTraceElement stacktraceelement = astacktraceelement[2];
                s = stacktraceelement.getMethodName();
                s1 = stacktraceelement.getClassName();
            }
            if(throwable == null)
                jdk14Logger.logp(level, s1, s, obj.toString());
            else
                jdk14Logger.logp(level, s1, s, obj.toString(), throwable);
        }
    }

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

    private static final String a = "unknown";
    private static final Level b;
    private static final Level c;
    private static final Level d;
    private static final Level e;
    private static final Level f;
    protected Logger jdk14Logger;

    static 
    {
        b = Level.FINE;
        c = Level.INFO;
        d = Level.WARNING;
        e = Level.SEVERE;
        f = Level.SEVERE;
    }

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