Skip to content

Commit 64b4243

Browse files
committed
Remove isDebug Check from IterableLogger
1 parent 09302b2 commit 64b4243

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableLogger.java

+7-16
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,43 @@
88
public class IterableLogger {
99

1010
public static void d(String tag, String msg) {
11-
if (isLoggable(Log.DEBUG)) {
11+
if (isLoggableLevel(Log.DEBUG)) {
1212
Log.d(tag, " 💚 " + msg);
1313
}
1414
}
1515

1616
public static void d(String tag, String msg, Throwable tr) {
17-
if (isLoggable(Log.DEBUG)) {
17+
if (isLoggableLevel(Log.DEBUG)) {
1818
Log.d(tag, " 💚 " + msg, tr);
1919
}
2020
}
2121

2222
public static void v(String tag, String msg) {
23-
if (isLoggable(Log.VERBOSE)) {
23+
if (isLoggableLevel(Log.VERBOSE)) {
2424
Log.v(tag, msg);
2525
}
2626
}
2727

2828
public static void w(String tag, String msg) {
29-
if (isLoggable(Log.WARN)) {
29+
if (isLoggableLevel(Log.WARN)) {
3030
Log.w(tag, " 🧡️ " + msg);
3131
}
3232
}
3333

3434
public static void w(String tag, String msg, Throwable tr) {
35-
if (isLoggable(Log.WARN)) {
35+
if (isLoggableLevel(Log.WARN)) {
3636
Log.w(tag, " 🧡 " + msg, tr);
3737
}
3838
}
3939

4040
public static void e(String tag, String msg) {
41-
if (isLoggable(Log.ERROR)) {
41+
if (isLoggableLevel(Log.ERROR)) {
4242
Log.e(tag, " ❤️ " + msg);
4343
}
4444
}
4545

4646
public static void e(String tag, String msg, Throwable tr) {
47-
if (isLoggable(Log.ERROR)) {
47+
if (isLoggableLevel(Log.ERROR)) {
4848
Log.e(tag, " ❤️ " + msg, tr);
4949
}
5050
}
@@ -57,15 +57,6 @@ public static void printInfo() {
5757
}
5858
}
5959

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-
6960
private static boolean isLoggableLevel(int messageLevel) {
7061
return messageLevel >= getLogLevel();
7162
}

0 commit comments

Comments
 (0)