国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

log打印統一管理類,一鍵關閉log打印

2019-11-09 14:53:36
字體:
來源:轉載
供稿:網友

關閉方式:在Myapplication的onCreate方法里

//        關閉log打印//        LogUtils.isDebug = false;

工具類代碼:

import android.util.Log;/** * Created by yanshanshu on 2016/12/8. * Log統一管理類 * */public class LogUtils {    PRivate LogUtils()    {        /* cannot be instantiated */        throw new UnsupportedOperationException("cannot be instantiated");    }    public static boolean isDebug = true;// 是否需要打印bug,可以在application的onCreate函數里面初始化    private static final String TAG = "way";    // 下面四個是默認tag的函數    public static void i(String msg)    {        if (isDebug)            Log.i(TAG, msg);    }    public static void d(String msg)    {        if (isDebug)            Log.d(TAG, msg);    }    public static void e(String msg)    {        if (isDebug)            Log.e(TAG, msg);    }    public static void v(String msg)    {        if (isDebug)            Log.v(TAG, msg);    }    // 下面是傳入自定義tag的函數    public static void i(String tag, String msg)    {        if (isDebug)            Log.i(tag, msg);    }    public static void d(String tag, String msg)    {        if (isDebug)            Log.i(tag, msg);    }    public static void e(String tag, String msg)    {        if (isDebug)            Log.i(tag, msg);    }    public static void v(String tag, String msg)    {        if (isDebug)            Log.i(tag, msg);    }}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 壤塘县| 碌曲县| 通辽市| 奉化市| 民勤县| 顺平县| 许昌县| 顺昌县| 长宁区| 玛纳斯县| 仁怀市| 兴义市| 宜春市| 商南县| 凉城县| 台东县| 中卫市| 安泽县| 潞城市| 姚安县| 通江县| 济宁市| 玉门市| 建瓯市| 东乡族自治县| 武定县| 河曲县| 马尔康县| 锡林郭勒盟| 六枝特区| 阳泉市| 余姚市| 启东市| 宾川县| 秭归县| 绥中县| 定南县| 房产| 宿迁市| 洛浦县| 洛浦县|