设为首页 加入收藏

TOP

常用的Log日志打印与输出(二)
2015-07-24 05:54:31 来源: 作者: 【 】 浏览:9
Tags:常用 Log 日志 打印 输出
ppend(COLON) .append(msg) .toString()); } public static void d(String msg) { if (isShowLog) d(TAG, msg); } public static void d(String tag, String msg) { if (isShowLog) Log.d(tag, msg); } public static void d(Class cls, String msg) { if (isShowLog) d(TAG,cls,msg); } public static void d(String tag,Class cls,String msg) { if (isShowLog) Log.d(tag, new StringBuilder() .append(cls.getSimpleName()) .append(COLON) .append(msg) .toString()); } public static void d(Class cls, String line, String msg) { if (isShowLog) d(TAG,cls,line,msg); } public static void d(String tag,Class cls, String line, String msg) { if (isShowLog) Log.d(tag, new StringBuilder() .append(line).append(COLON) .append(cls.getSimpleName()) .append(COLON) .append(msg) .toString()); } //-----------------------------------Log.i /** * Log.i * @param e */ public static void i(Throwable e) { if (isShowLog) i(TAG,e); } public static void i(String tag,Throwable e) { if (isShowLog) Log.i(tag, new StringBuilder() .append(e.getStackTrace()[0].getLineNumber()) .append(COLON) .append(e.getStackTrace()[0].getClassName()) .append(ARROW) .append(e.getStackTrace()[0].getMethodName()) .append(COLON) .append(e.getMessage()) .toString()); } public static void i(Throwable e,String msg) { if (isShowLog) i(TAG,e,msg); } public static void i(String tag,Throwable e,String msg) { if (isShowLog) Log.i(tag, new StringBuilder() .append(e.getStackTrace()[0].getLineNumber()) .append(COLON) .append(e.getStackTrace()[0].getClassName()) .append(ARROW) .append(e.getStackTrace()[0].getMethodName()) .append(COLON) .append(msg) .toString()); } public static void i(String msg) { if (isShowLog) i(TAG, msg); } public static void i(String tag, String msg) { if (isShowLog) Log.i(tag, msg); } public static void i(Class cls, String msg) { if (isShowLog) i(TAG,cls,msg); } public static void i(String tag,Class cls,String msg) { if (isShowLog) Log.i(tag, new StringBuilder() .append(cls.getSimpleName()) .append(COLON) .append(msg) .toString()); } public static void i(Class cls, String line, String msg) { if (isShowLog) v(TAG,cls,line,msg); } public static void i(String tag,Class cls, String line, String msg) { if (isShowLog) Log.i(tag, new StringBuilder() .append(line).append(COLON) .append(cls.getSimpleName()) .append(COLON) .append(msg) .toString()); } //-----------------------------------Log.w /** * Log.w * @param e */ public static void w(Throwable e) { if (isShowLog) w(TAG,e); } public static void w(String tag,Throwable e) { if (isShowLog) Log.w(tag, new StringBuilder() .append(e.getStackTrace()[0].getLineNumber()) .append(COLON) .append(e.getStackTrace()[0].getClassName()) .append(ARROW) .append(e.getStackTrace()[0
首页 上一页 1 2 3 4 下一页 尾页 2/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇LeetCode:Substring with Concate.. 下一篇kd-tree讲解 & bzoj 2648 &am..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: