From ad55a9addc4bd045b8af6bb541e58abc2b32460d Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 31 May 2019 15:31:38 +0200 Subject: [PATCH] Prefix server logs Sometimes, it is not obvious whether a log is generated by the server or by the client. Prefix server logs for clarity. --- server/src/main/java/com/genymobile/scrcpy/Ln.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/Ln.java b/server/src/main/java/com/genymobile/scrcpy/Ln.java index cd466b3e..bb741225 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Ln.java +++ b/server/src/main/java/com/genymobile/scrcpy/Ln.java @@ -9,6 +9,7 @@ import android.util.Log; public final class Ln { private static final String TAG = "scrcpy"; + private static final String PREFIX = "[server] "; enum Level { DEBUG, @@ -30,28 +31,28 @@ public final class Ln { public static void d(String message) { if (isEnabled(Level.DEBUG)) { Log.d(TAG, message); - System.out.println("DEBUG: " + message); + System.out.println(PREFIX + "DEBUG: " + message); } } public static void i(String message) { if (isEnabled(Level.INFO)) { Log.i(TAG, message); - System.out.println("INFO: " + message); + System.out.println(PREFIX + "INFO: " + message); } } public static void w(String message) { if (isEnabled(Level.WARN)) { Log.w(TAG, message); - System.out.println("WARN: " + message); + System.out.println(PREFIX + "WARN: " + message); } } public static void e(String message, Throwable throwable) { if (isEnabled(Level.ERROR)) { Log.e(TAG, message, throwable); - System.out.println("ERROR: " + message); + System.out.println(PREFIX + "ERROR: " + message); if (throwable != null) { throwable.printStackTrace(); }