Skip to content

Display and control your Android device

Add throwable parameter to Log.w()

Romain Vimont48b572c27290
diff --git a/server/src/main/java/com/genymobile/scrcpy/Ln.java b/server/src/main/java/com/genymobile/scrcpy/Ln.java
index 061cda95..c39fc621 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Ln.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Ln.java
@@ -57,13 +57,20 @@ public final class Ln {
}
}
- public static void w(String message) {
+ public static void w(String message, Throwable throwable) {
if (isEnabled(Level.WARN)) {
- Log.w(TAG, message);
+ Log.w(TAG, message, throwable);
System.out.println(PREFIX + "WARN: " + message);
+ if (throwable != null) {
+ throwable.printStackTrace();
+ }
}
}
+ public static void w(String message) {
+ w(message, null);
+ }
+
public static void e(String message, Throwable throwable) {
if (isEnabled(Level.ERROR)) {
Log.e(TAG, message, throwable);