设为首页 加入收藏

TOP

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

评论

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