在Logcat控制窗中查看日志,并且可以链接到具体打印日志代码的地方,使用方便
package com.huaxindata.cdspongecityproduct.service.util;
import android.text.TextUtils;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class HxLogUtils {
public static String TAG = "Hx";
public static boolean LOG_DEBUG = true;
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
private static final int VERBOSE = 2;
private static final int DEBUG = 3;
private static final int INFO = 4;
private static final int WARN = 5;
private static final int ERROR = 6;
private static final int ASSERT = 7;
private static final int JSON = 8;
private static final int XML = 9;
private static final int JSON_INDENT = 4;
public static void init(boolean isDebug, String tag) {
TAG = tag;
LOG_DEBUG = isDebug;
}
public static