@@ -14,37 +14,37 @@ public static void d(String tag, String msg) {
14
14
}
15
15
16
16
public static void d (String tag , String msg , Throwable tr ) {
17
- if (isLoggableLevel (Log .DEBUG )) {
17
+ if (isLoggable (Log .DEBUG )) {
18
18
Log .d (tag , " 💚 " + msg , tr );
19
19
}
20
20
}
21
21
22
22
public static void v (String tag , String msg ) {
23
- if (isLoggableLevel (Log .VERBOSE )) {
23
+ if (isLoggable (Log .VERBOSE )) {
24
24
Log .v (tag , msg );
25
25
}
26
26
}
27
27
28
28
public static void w (String tag , String msg ) {
29
- if (isLoggableLevel (Log .WARN )) {
29
+ if (isLoggable (Log .WARN )) {
30
30
Log .w (tag , " 🧡️ " + msg );
31
31
}
32
32
}
33
33
34
34
public static void w (String tag , String msg , Throwable tr ) {
35
- if (isLoggableLevel (Log .WARN )) {
35
+ if (isLoggable (Log .WARN )) {
36
36
Log .w (tag , " 🧡 " + msg , tr );
37
37
}
38
38
}
39
39
40
40
public static void e (String tag , String msg ) {
41
- if (isLoggableLevel (Log .ERROR )) {
41
+ if (isLoggable (Log .ERROR )) {
42
42
Log .e (tag , " ❤️ " + msg );
43
43
}
44
44
}
45
45
46
46
public static void e (String tag , String msg , Throwable tr ) {
47
- if (isLoggableLevel (Log .ERROR )) {
47
+ if (isLoggable (Log .ERROR )) {
48
48
Log .e (tag , " ❤️ " + msg , tr );
49
49
}
50
50
}
@@ -57,6 +57,15 @@ public static void printInfo() {
57
57
}
58
58
}
59
59
60
+ private static boolean isLoggable (int messageLevel ) {
61
+ boolean isDebug = ((IterableApi .getInstance ().getMainActivityContext ().getApplicationInfo ().flags & IterableApi .getInstance ().getMainActivityContext ().getApplicationInfo ().FLAG_DEBUGGABLE ) != 0 );
62
+ if (isDebug ){
63
+ return isLoggableLevel (messageLevel );
64
+ }
65
+ // Log level will be set to WARNING and above if in release mode.
66
+ return messageLevel >= Log .WARN ;
67
+ }
68
+
60
69
private static boolean isLoggableLevel (int messageLevel ) {
61
70
return messageLevel >= getLogLevel ();
62
71
}
0 commit comments