37 lines
923 B
Java
Raw Normal View History

2016-09-21 16:55:20 -05:00
package com.topjohnwu.magisk.utils;
import android.util.Log;
2017-05-31 17:43:55 +08:00
import java.util.Locale;
2016-09-21 16:55:20 -05:00
2017-05-31 17:43:55 +08:00
public class Logger {
2016-09-21 16:55:20 -05:00
2017-10-14 03:31:48 +08:00
private static final boolean SHELL_LOGGING = false;
2017-01-25 16:45:55 +08:00
2017-07-16 01:20:39 +08:00
public static void debug(String line) {
2017-11-06 04:41:23 +08:00
Log.d(Const.DEBUG_TAG, "DEBUG: " + line);
2017-07-16 01:20:39 +08:00
}
2017-05-31 17:43:55 +08:00
public static void debug(String fmt, Object... args) {
2017-07-16 01:20:39 +08:00
debug(String.format(Locale.US, fmt, args));
}
public static void error(String line) {
2017-11-06 04:41:23 +08:00
Log.e(Const.DEBUG_TAG, "ERROR: " + line);
2016-12-23 23:05:41 +08:00
}
2017-05-31 17:43:55 +08:00
public static void error(String fmt, Object... args) {
2017-07-16 01:20:39 +08:00
error(String.format(Locale.US, fmt, args));
2016-09-21 16:55:20 -05:00
}
2016-09-21 23:36:28 -05:00
2017-10-19 20:37:58 +08:00
public static void shell(boolean in, String line) {
2017-10-14 03:31:48 +08:00
if (SHELL_LOGGING) {
2017-11-06 04:41:23 +08:00
Log.d(Const.DEBUG_TAG, (in ? "SHELLIN : " : "SHELLOUT: ") + line);
2016-09-30 10:41:40 +08:00
}
}
2017-07-16 01:20:39 +08:00
2017-10-19 20:37:58 +08:00
public static void shell(boolean in, String fmt, Object... args) {
shell(in, String.format(Locale.US, fmt, args));
2017-07-16 01:20:39 +08:00
}
2016-09-21 16:55:20 -05:00
}