Androdi 封装Log类
下类会在输出信息中打印当前类及所在的方法名
public class LogUtils {
public static String TAG = "shoujidom";
public static void logi(Object object) {
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
String fileName = stackTrace[3].getFileName();
String methodName = stackTrace[3].getMethodName();
object = "[" +fileName + "] " + "[" + methodName + "] " + object;
Log.i(TAG, object + "");
}
}
版权声明:如无特殊标注,文章均为本站原创,转载时请以链接形式注明文章出处。
评论