国产探花免费观看_亚洲丰满少妇自慰呻吟_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開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 肃宁县| 仪征市| 平安县| 安达市| 讷河市| 宁晋县| 正镶白旗| 改则县| 江都市| 深水埗区| 延吉市| 卫辉市| 永安市| 桃江县| 海林市| 科技| 湖北省| 沁水县| 安顺市| 延寿县| 扬州市| 四会市| 昆山市| 塔河县| 土默特右旗| 万荣县| 大悟县| 平果县| 开远市| 北海市| 永城市| 扬中市| 福建省| 阿拉善盟| 新疆| 尼玛县| 东光县| 汪清县| 柯坪县| 府谷县| 开阳县|