MCPcopy Create free account
hub / github.com/Justson/AgentWeb / LogUtils

Class LogUtils

agentweb-core/src/main/java/com/just/agentweb/LogUtils.java:26–67  ·  view source on GitHub ↗

@author cenxiaozhong @date 2017/5/28 @since 1.0.0

Source from the content-addressed store, hash-verified

24 * @since 1.0.0
25 */
26class LogUtils {
27
28 private static final String PREFIX = "agentweb-";
29
30 static boolean isDebug() {
31 return AgentWebConfig.DEBUG;
32 }
33
34 static void i(String tag, String message) {
35
36 if (isDebug()) {
37 Log.i(PREFIX.concat(tag), message);
38 }
39 }
40
41 static void v(String tag, String message) {
42
43 if (isDebug()) {
44 Log.v(PREFIX.concat(tag), message);
45 }
46
47 }
48
49 static void safeCheckCrash(String tag, String msg, Throwable tr) {
50 if (isDebug()) {
51 throw new RuntimeException(PREFIX.concat(tag) + " " + msg, tr);
52 } else {
53 Log.e(PREFIX.concat(tag), msg, tr);
54 }
55 }
56
57 static void e(String tag, String msg, Throwable tr) {
58 Log.e(tag, msg, tr);
59 }
60
61 static void e(String tag, String message) {
62
63 if (isDebug()) {
64 Log.e(PREFIX.concat(tag), message);
65 }
66 }
67}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected