zoukankan      html  css  js  c++  java
  • Android 开发工具类 05_Logcat 统一管理类

    Logcat 统一管理类:

    1、默 认tag 的函数;

    2、自定义 tag 的函数。

     1 import android.util.Log;
     2 
     3 // Logcat 统一管理类
     4 public class L
     5 {
     6 
     7     private L()
     8     {
     9         /* cannot be instantiated */
    10         throw new UnsupportedOperationException("cannot be instantiated");
    11     }
    12 
    13     public static boolean isDebug = true;// 是否需要打印 bug,可以在 application的onCreate函数里面初始化
    14     private static final String TAG = "way";
    15 
    16     // 下面四个是默 认tag 的函数
    17     public static void i(String msg)
    18     {
    19         if (isDebug)
    20             Log.i(TAG, msg);
    21     }
    22 
    23     public static void d(String msg)
    24     {
    25         if (isDebug)
    26             Log.d(TAG, msg);
    27     }
    28 
    29     public static void e(String msg)
    30     {
    31         if (isDebug)
    32             Log.e(TAG, msg);
    33     }
    34 
    35     public static void v(String msg)
    36     {
    37         if (isDebug)
    38             Log.v(TAG, msg);
    39     }
    40 
    41     // 下面是传入自定义 tag 的函数
    42     public static void i(String tag, String msg)
    43     {
    44         if (isDebug)
    45             Log.i(tag, msg);
    46     }
    47 
    48     public static void d(String tag, String msg)
    49     {
    50         if (isDebug)
    51             Log.i(tag, msg);
    52     }
    53 
    54     public static void e(String tag, String msg)
    55     {
    56         if (isDebug)
    57             Log.i(tag, msg);
    58     }
    59 
    60     public static void v(String tag, String msg)
    61     {
    62         if (isDebug)
    63             Log.i(tag, msg);
    64     }
    65 }
  • 相关阅读:
    Mat
    分治法-最近点对问题
    动态规划作业-最长公共子序列问题
    动态规划作业-多段图的最短路径问题
    OpenCV+VisualStudion2017配置
    R入门(二)-对象以及它们的模式和属性
    Big number
    R入门(一)
    Spring-aop
    Spring-ioc
  • 原文地址:https://www.cnblogs.com/renzimu/p/4535648.html
Copyright © 2011-2022 走看看