scrcpy/server/src/main/java/com/genymobile/scrcpy/Ln.java
Romain Vimont b67907e24e Convert server to an Android project
To simplify the device server-side build, use gradle to create an APK,
even if we use it as a simple jar, by running its main() method.
2018-01-30 12:01:36 +01:00

38 lines
923 B
Java

package com.genymobile.scrcpy;
import android.util.Log;
/**
* Log both to Android logger (so that logs are visible in "adb logcat") and standard output/error (so that they are visible in the terminal
* directly).
*/
public class Ln {
private static final String TAG = "scrcpy";
private Ln() {
// not instantiable
}
public static void d(String message) {
Log.d(TAG, message);
System.out.println("DEBUG: " + message);
}
public static void i(String message) {
Log.i(TAG, message);
System.out.println("INFO: " + message);
}
public static void w(String message) {
Log.w(TAG, message);
System.out.println("WARN: " + message);
}
public static void e(String message, Throwable throwable) {
Log.e(TAG, message, throwable);
System.out.println("ERROR: " + message);
throwable.printStackTrace();
}
}