package macampcorp.macamp.utils;

import android.util.Log;

public class L {
    public static String PREFIXE = "macampcorp.macamp.activities";

    public static void debug(String prefix, String a)
    {
        Log.d(prefix, P()+a);
    }

    public static void debug(String a)
    {
        Log.d(PREFIXE, P()+a);
    }

    public static void warn(String prefix, String a)
    {
        Log.w(prefix, P()+a);
    }

    public static void warn(String a)
    {
        Log.w(PREFIXE, P()+a);
    }

    public static void error(String prefix, String a)
    {
        Log.e(prefix, P()+a);
    }

    public static void error(String a)
    {
        Log.e(PREFIXE, P()+a);
    }


    public static void info(String prefix, String a)
    {
        Log.i(prefix, P()+a);
    }

    public static void info(String a)
    {
        Log.i(PREFIXE, P()+a);
    }

    public static String P()
    {
        return functionName()+": ";
    }

    public static String stackTrace(int i)
    {
        StackTraceElement[] stack = Thread.currentThread().getStackTrace();
        String str="";
        for(; i<stack.length; i++)
            str+=i+" "+stack[i]+"\n";
        return str;
    }

    public static String functionName()
    {
        StackTraceElement[] stack = Thread.currentThread().getStackTrace();
        return stack[5]+"";
    }

}
