debuglog.java

来自「java se平台蓝牙开发的插件 ,包括源码 根据readme 生成包很多东西可」· Java 代码 · 共 89 行

JAVA
89
字号
package com.intel.bluetooth;/** * The methods of this calls would be removed automaticaly because they are * empty if debugCompiledOut = true. *  * This class itself will disappear from bytecode after obfuscation by proguard. *  */public class DebugLog {	private static final boolean debugCompiledOut = true;		private static boolean debugEnabled = false;	private static boolean initialized = true;		private static void initialize() {		initialized = true;		if (!debugCompiledOut) {			String d = System.getProperty("bluecove.debug");			debugEnabled = ((d != null) && (d.equalsIgnoreCase("true") || d.equalsIgnoreCase("1")));		}	}		public static boolean isDebugEnabled() {		if (!initialized) {			initialize();		}		return debugEnabled;	}		public static void debug(String message) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println(message);		}	}		public static void debug(String message, String v) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println(message + " " + v);		}	}	public static void debug(String message, Object obj) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println(message + " " + obj.toString());		}	}		public static void debug(String message, String v, String v2) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println(message + " " + v + " " + v2);		}	}		public static void debug(String message, long v) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println(message + " " + String.valueOf(v));		}	}	public static void debug(String message, boolean v) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println(message + " " + v);		}	}		public static void error(String message, long v) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println("error " + message + " " + v);		}	}		public static void error(String message, String v) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println("error " + message + " " + v);		}	}		public static void error(String message, Throwable t) {		if (!debugCompiledOut && isDebugEnabled()) {			System.out.println("error " + message + " " + t);			t.printStackTrace();		}	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?