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
This commit is contained in:
parent
4507c6870d
commit
06586b75b0
@ -88,8 +88,7 @@ public final class Log {
|
|||||||
public static void d(String tag, String message, @Nullable Throwable throwable) {
|
public static void d(String tag, String message, @Nullable Throwable throwable) {
|
||||||
if (!logStackTraces) {
|
if (!logStackTraces) {
|
||||||
d(tag, appendThrowableMessage(message, throwable));
|
d(tag, appendThrowableMessage(message, throwable));
|
||||||
}
|
} else if (logLevel == LOG_LEVEL_ALL) {
|
||||||
if (logLevel == LOG_LEVEL_ALL) {
|
|
||||||
android.util.Log.d(tag, message, throwable);
|
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) {
|
public static void i(String tag, String message, @Nullable Throwable throwable) {
|
||||||
if (!logStackTraces) {
|
if (!logStackTraces) {
|
||||||
i(tag, appendThrowableMessage(message, throwable));
|
i(tag, appendThrowableMessage(message, throwable));
|
||||||
}
|
} else if (logLevel <= LOG_LEVEL_INFO) {
|
||||||
if (logLevel <= LOG_LEVEL_INFO) {
|
|
||||||
android.util.Log.i(tag, message, throwable);
|
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) {
|
public static void w(String tag, String message, @Nullable Throwable throwable) {
|
||||||
if (!logStackTraces) {
|
if (!logStackTraces) {
|
||||||
w(tag, appendThrowableMessage(message, throwable));
|
w(tag, appendThrowableMessage(message, throwable));
|
||||||
}
|
} else if (logLevel <= LOG_LEVEL_WARNING) {
|
||||||
if (logLevel <= LOG_LEVEL_WARNING) {
|
|
||||||
android.util.Log.w(tag, message, throwable);
|
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) {
|
public static void e(String tag, String message, @Nullable Throwable throwable) {
|
||||||
if (!logStackTraces) {
|
if (!logStackTraces) {
|
||||||
e(tag, appendThrowableMessage(message, throwable));
|
e(tag, appendThrowableMessage(message, throwable));
|
||||||
}
|
} else if (logLevel <= LOG_LEVEL_ERROR) {
|
||||||
if (logLevel <= LOG_LEVEL_ERROR) {
|
|
||||||
android.util.Log.e(tag, message, throwable);
|
android.util.Log.e(tag, message, throwable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user