首页 > 移动平台 > 详细

Android Logcat 封装类

时间:2015-04-13 18:28:20      阅读:162      评论:0      收藏:0      [点我收藏+]

简单日志封装类:

public final class CLog {
    public static final boolean DEBUG = true;

    private CLog() {
    }

    public static void d(String tag, String desc) {
        if (DEBUG)
            Log.d(tag, desc);
    }
    
    public static void d(String tag, String desc, Throwable tr) {
        if (DEBUG)
            Log.d(tag, desc, tr);
    }

    public static void v(String tag, String desc) {
        if (DEBUG)
            Log.v(tag, desc);
    }
    public static void v(String tag, String desc, Throwable tr) {
        if (DEBUG)
            Log.v(tag, desc);
    }

    public static void w(String tag, String desc) {
        if (DEBUG)
            Log.w(tag, desc);
    }

    public static void w(String tag, Throwable ioe) {
        if (DEBUG)
            Log.w(tag, ioe);
    }

    public static void w(String tag, String desc, Throwable e) {
        if (DEBUG)
            Log.w(tag, desc, e);
    }

    public static void i(String tag, String desc) {
        if (DEBUG)
            Log.i(tag, desc);
    }
    
    public static void i(String tag, String desc, Throwable tr) {
        if (DEBUG)
            Log.i(tag, desc, tr);
    }

    public static void e(String tag, String desc) {
        if (DEBUG)
            Log.e(tag, desc);
    }
    
    public static void e(String tag, String desc, Throwable tr) {
        if (DEBUG)
            Log.e(tag, desc, tr);
    }
}

  

Android Logcat 封装类

原文:http://www.cnblogs.com/cr330326/p/4422444.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!