Commit 61551398 by tonihei Committed by Oliver Woodman

Fix bug which logs errors twice if stack traces are disabled.

Disabling stack trackes currently logs messages twice, once with and once
without stack trace.

PiperOrigin-RevId: 244853127
parent 3d6407a5
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment