I can't understand why Google made Log so complex. It could be that easy. Instead of Log.X just type L.X (import the class first). The tag is set automatically - you can choose between the Class, Class.Method, Class:LineNumer or Class.Method:LineNumber as tags - awesome, right?
//Use it: L.e("Hello World! I am an error."); L.setLogType(LogType.CLASS_AND_METHOD_AND_LINE); L.e("wow so easy!");
import android.util.Log; public class L { public static enum LogType { CLASS, CLASS_AND_METHOD, CLASS_AND_METHOD_AND_LINE, CLASS_AND_LINE } private static LogType mType = LogType.CLASS; public static void setLogType(LogType type) { mType = type; } public static void e(String msg) { Log.e(getTag(), msg); } public static void i(String msg) { Log.i(getTag(), msg); } public static void d(String msg) { Log.d(getTag(), msg); } public static void v(String msg) { Log.v(getTag(), msg); } public static void w(String msg) { Log.w(getTag(), msg); } public static void wtf(String msg) { Log.wtf(getTag(), msg); } private static String getTag() { StackTraceElement[] s = Thread.currentThread().getStackTrace(); switch (mType) { case CLASS: return s[4].getClassName(); case CLASS_AND_LINE: return s[4].getClassName()+":"+s[4].getLineNumber(); case CLASS_AND_METHOD: return s[4].getClassName()+"."+s[4].getMethodName(); case CLASS_AND_METHOD_AND_LINE: return s[4].getClassName()+"."+s[4].getMethodName()+":"+s[4].getLineNumber(); default: break; } return null; } }
Casino Poker Tournaments with the best bonuses 2021
AntwortenLöschenIf you like playing at the 벳인포해외배당흐름 casino, you 토토 분석 사이트 can find 토토검증먹튀랭크 hundreds of different casino 우리계열 tournaments 캔 토토 with the best bonus offers for players. Join Casino Poker now!