| | |
| | | */ |
| | | public class HdlLogLogic { |
| | | |
| | | |
| | | /** |
| | | * 是否需要打印(true不需要打印) |
| | | */ |
| | | public static boolean isDebug = false; |
| | | |
| | | private static volatile HdlLogLogic sHdlLogLogic; |
| | | |
| | | /** |
| | | * 获取当前对象 |
| | | * |
| | | * @return HdlLogLogic |
| | | */ |
| | | public static synchronized HdlLogLogic getInstance() { |
| | | if (sHdlLogLogic == null) { |
| | | synchronized (HdlLogLogic.class) { |
| | |
| | | return sHdlLogLogic; |
| | | } |
| | | |
| | | /** |
| | | * android打印 |
| | | * |
| | | * @param tag 标签 |
| | | * @param mgs 输出信息 |
| | | */ |
| | | public static void print(String tag, String mgs) { |
| | | if (isDebug) { |
| | | return; |
| | | } |
| | | Log.d(tag, mgs); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * java打印 |
| | | * |
| | | * @param mgs 输出信息 |
| | | */ |
| | | public static void print(String mgs) { |
| | | if (isDebug) { |
| | | return; |
| | | } |
| | | System.out.println(mgs); |
| | | } |
| | | |
| | | } |