|  |  | 
 |  |  | package com.hdl.sdk.common.utils;
 | 
 |  |  | 
 | 
 |  |  | import android.util.Log;
 | 
 |  |  | 
 | 
 |  |  | /**
 | 
 |  |  |  * Created by Tong on 2021/9/23.
 | 
 |  |  |  */
 | 
 |  |  | public class LogUtils {
 | 
 |  |  | 
 | 
 |  |  |     private static final String TAG = "HDLSocket";
 | 
 |  |  |     private static final String TAG = "HDLSDK";
 | 
 |  |  | 
 | 
 |  |  |     private boolean isEnabled = true;
 | 
 |  |  |     private static boolean isEnabled = true;
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  |     private LogUtils() {
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     private static class SingletonInstance {
 | 
 |  |  |         private static final LogUtils INSTANCE = new LogUtils();
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static LogUtils getInstance() {
 | 
 |  |  |         return SingletonInstance.INSTANCE;
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public boolean isEnabled() {
 | 
 |  |  |     public static boolean isEnabled() {
 | 
 |  |  |         return isEnabled;
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public void setEnabled(boolean enabled) {
 | 
 |  |  |     public static void setEnabled(boolean enabled) {
 | 
 |  |  |         isEnabled = enabled;
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static void d(String tag, String msg) {
 | 
 |  |  | 
 | 
 |  |  |         if (tag != null && msg != null && isEnabled) {
 | 
 |  |  |             Log.d(TAG, tag + "-- " + msg);
 | 
 |  |  |         }
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static void e(String tag, String msg) {
 | 
 |  |  | 
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static void e(String msg, Throwable tr) {
 | 
 |  |  | 
 | 
 |  |  |         if (tag != null && msg != null && isEnabled) {
 | 
 |  |  |             Log.e(TAG, tag + "-- " + msg);
 | 
 |  |  |         }
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static void w(String tag, String msg) {
 | 
 |  |  | 
 | 
 |  |  |         if (tag != null && msg != null && isEnabled) {
 | 
 |  |  |             Log.w(TAG, tag + "-- " + msg);
 | 
 |  |  |         }
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static void v(String tag, String msg) {
 | 
 |  |  | 
 | 
 |  |  |         if (tag != null && msg != null && isEnabled) {
 | 
 |  |  |             Log.v(TAG, tag + "-- " + msg);
 | 
 |  |  |         }
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static void i(String tag, String msg) {
 | 
 |  |  |         if (tag != null && msg != null && isEnabled) {
 | 
 |  |  |             Log.i(TAG, tag + "-- " + msg);
 | 
 |  |  |         }
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static void i(String msg) {
 | 
 |  |  |         if (msg != null && isEnabled) {
 | 
 |  |  |             Log.i(TAG, msg);
 | 
 |  |  |         }
 | 
 |  |  |     }
 | 
 |  |  | 
 | 
 |  |  |     public static void e(String msg) {
 | 
 |  |  |         if (msg != null && isEnabled) {
 | 
 |  |  |             Log.e(TAG,  msg);
 | 
 |  |  |         }
 | 
 |  |  |     }
 | 
 |  |  | }
 |