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

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

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

2019-11-09 16:05:29
字體:
來源:轉載
供稿:網友

關閉方式:在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);    }}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 兰溪市| 岑巩县| 聊城市| 手游| 深泽县| 平乐县| 上杭县| 五家渠市| 吉安县| 通河县| 诸城市| 雅江县| 白水县| 迭部县| 巧家县| 天柱县| 瑞金市| 怀来县| 霸州市| 阿巴嘎旗| 黄大仙区| 确山县| 蛟河市| 临桂县| 瑞丽市| 香河县| 朝阳市| 龙游县| 阿城市| 河津市| 嘉兴市| 柳河县| 新源县| 陆川县| 鄱阳县| 甘肃省| 若尔盖县| 鹤岗市| 万荣县| 怀来县| 西安市|