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.
@@ -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();
}
