package cs451.tools;

/**
 * Logger Class to log events, errors,....
 */
public abstract class Logger {

    public enum LOG_LEVEL{
        ERR(-1),
        INFO(0),
        DEBUG(1),
        ALL(99);

        public final Integer v;
        LOG_LEVEL(Integer v){
            this.v = v;
        }
        public boolean isEnabled(){
            return  this.v <= LVL.v;
        }
    }

    private static final LOG_LEVEL LVL = LOG_LEVEL.ALL;

    public static void info(String msg){
        if(LOG_LEVEL.INFO.isEnabled()){
            System.out.println(msg);
        }
    }

    public static void debug(String msg){
        if(LOG_LEVEL.DEBUG.isEnabled()){
            System.err.println(msg);
        }
    }

    public static void error(String msg){
        if(LOG_LEVEL.ERR.isEnabled()){
            System.err.println(msg);
        }
    }



}
