-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathLogUtil.java
More file actions
77 lines (66 loc) · 1.85 KB
/
Copy pathLogUtil.java
File metadata and controls
77 lines (66 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.realmo.utils;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.util.Log;
public class LogUtil {
public static final String _TAG = "realmo";
public static boolean isEshow=true;
public static boolean isWshow=true;
public static boolean isIshow=true;
public static boolean isDshow=true;
public static boolean isVshow=true;
static{
if (isApkDebugable(RealMoApp.getInstance())){
isEshow=true;
isWshow=true;
isIshow=true;
isDshow=true;
isVshow=true;
}else {
isEshow=true;
isWshow=false;
isIshow=false;
isDshow=false;
isVshow=false;
}
}
public static boolean isApkDebugable(Context context) {
try {
ApplicationInfo info= context.getApplicationInfo();
return (info.flags& ApplicationInfo.FLAG_DEBUGGABLE)== ApplicationInfo.FLAG_DEBUGGABLE;
} catch (Exception e) {
}
return false;
}
public static void d(String msg){
if(isDshow)
Log.d(_TAG, msg);
}
public static void d(String tag, String msg){
d(tag+","+msg);
}
public static void e(String msg){
if(isEshow) Log.e(_TAG, msg);
}
public static void e(String tag, String msg){
e(tag+","+msg);
}
public static void i(String msg){
if(isIshow) Log.i(_TAG, msg);
}
public static void i(String tag, String msg){
i(tag+","+msg);
}
public static void w(String msg){
if(isWshow) Log.w(_TAG, msg);
}
public static void w(String tag, String msg){
w(tag+","+msg);
}
public static void v(String msg){
if(isVshow) Log.v(_TAG, msg);
}
public static void v(String tag, String msg){
v(tag+","+msg);
}
}