diff --git a/library/core/src/main/java/com/google/android/exoplayer2/util/Log.java b/library/core/src/main/java/com/google/android/exoplayer2/util/Log.java index 2c3e4f1e7c..1eb0977847 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/util/Log.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/util/Log.java @@ -88,8 +88,7 @@ public final class Log { public static void d(String tag, String message, @Nullable Throwable throwable) { if (!logStackTraces) { d(tag, appendThrowableMessage(message, throwable)); - } - if (logLevel == LOG_LEVEL_ALL) { + } else if (logLevel == LOG_LEVEL_ALL) { android.util.Log.d(tag, message, throwable); } } @@ -105,8 +104,7 @@ public final class Log { public static void i(String tag, String message, @Nullable Throwable throwable) { if (!logStackTraces) { i(tag, appendThrowableMessage(message, throwable)); - } - if (logLevel <= LOG_LEVEL_INFO) { + } else if (logLevel <= LOG_LEVEL_INFO) { android.util.Log.i(tag, message, throwable); } } @@ -122,8 +120,7 @@ public final class Log { public static void w(String tag, String message, @Nullable Throwable throwable) { if (!logStackTraces) { w(tag, appendThrowableMessage(message, throwable)); - } - if (logLevel <= LOG_LEVEL_WARNING) { + } else if (logLevel <= LOG_LEVEL_WARNING) { android.util.Log.w(tag, message, throwable); } } @@ -139,8 +136,7 @@ public final class Log { public static void e(String tag, String message, @Nullable Throwable throwable) { if (!logStackTraces) { e(tag, appendThrowableMessage(message, throwable)); - } - if (logLevel <= LOG_LEVEL_ERROR) { + } else if (logLevel <= LOG_LEVEL_ERROR) { android.util.Log.e(tag, message, throwable); } }