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

首頁 > 系統 > Android > 正文

Android開發實現的Log統一管理類

2019-10-22 18:21:47
字體:
來源:轉載
供稿:網友

本文實例講述了Android開發實現的Log統一管理類。分享給大家供大家參考,具體如下:

/** * Log統一管理類 *  * */public class Logger{  private Logger()  {    /* cannot be instantiated */    throw new UnsupportedOperationException("cannot be instantiated");  }  public static boolean isDebug = true;// 是否需要打印bug,可以在application的onCreate函數里面初始化  private static final String TAG = "tag";  // 下面四個是默認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);  }}

希望本文所述對大家Android程序設計有所幫助。


注:相關教程知識閱讀請移步到Android開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 昔阳县| 永寿县| 浦城县| 鹿泉市| 榕江县| 贡觉县| 民丰县| 晋江市| 姚安县| 新河县| 玉屏| 德格县| 汉川市| 绥化市| 体育| 金秀| 新民市| 高青县| 都兰县| 兴隆县| 芜湖县| 外汇| 石景山区| 枣强县| 射阳县| 洛隆县| 浮梁县| 渝中区| 黎川县| 建始县| 团风县| 类乌齐县| 望城县| 泰和县| 河池市| 略阳县| 塔城市| 古丈县| 余姚市| 西贡区| 历史|