From 2837c6eaab51eac7bc18c5a0848754a203970f44 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 4 May 2019 14:40:29 +0200 Subject: [PATCH] Add method to log error without throwable Add Ln.e(message) in addition to Ln.e(message, error). --- server/src/main/java/com/genymobile/scrcpy/Ln.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/Ln.java b/server/src/main/java/com/genymobile/scrcpy/Ln.java index 9364519e..cd466b3e 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Ln.java +++ b/server/src/main/java/com/genymobile/scrcpy/Ln.java @@ -52,7 +52,13 @@ public final class Ln { if (isEnabled(Level.ERROR)) { Log.e(TAG, message, throwable); System.out.println("ERROR: " + message); - throwable.printStackTrace(); + if (throwable != null) { + throwable.printStackTrace(); + } } } + + public static void e(String message) { + e(message, null); + } }