| | |
| | | */
|
| | | 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) {
|
| | | System.out.println(tag + "-- " + msg);
|
| | | }
|
| | | }
|
| | |
|
| | | public static void e(String tag, String msg) {
|
| | |
|
| | | }
|
| | |
|
| | | public static void e(String msg, Throwable tr) {
|
| | |
|
| | | if (tag != null && msg != null && isEnabled) {
|
| | | System.out.println(tag + "-- " + msg);
|
| | | }
|
| | | }
|
| | |
|
| | | public static void w(String tag, String msg) {
|
| | |
|
| | | if (tag != null && msg != null && isEnabled) {
|
| | | System.out.println(tag + "-- " + msg);
|
| | | }
|
| | | }
|
| | |
|
| | | public static void v(String tag, String msg) {
|
| | |
|
| | | if (tag != null && msg != null && isEnabled) {
|
| | | System.out.println(tag + "-- " + msg);
|
| | | }
|
| | | }
|
| | |
|
| | | public static void i(String tag, String msg) {
|
| | | if (tag != null && msg != null && isEnabled) {
|
| | | System.out.println(tag + "-- " + msg);
|
| | | }
|
| | | }
|
| | |
|
| | | public static void i(String msg) {
|
| | | if (msg != null && isEnabled) {
|
| | | System.out.println(msg);
|
| | | }
|
| | | }
|
| | |
|
| | | public static void e(String msg) {
|
| | | if (msg != null && isEnabled) {
|
| | | System.out.println(msg);
|
| | | }
|
| | | }
|
| | | }
|