[DEV] update log interface
This commit is contained in:
parent
343934129a
commit
2c42ee071c
@ -4,7 +4,7 @@ import io.scenarium.logger.LogLevel;
|
|||||||
import io.scenarium.logger.Logger;
|
import io.scenarium.logger.Logger;
|
||||||
|
|
||||||
public class Log {
|
public class Log {
|
||||||
private static final boolean FORCE_DISPLAY = true;
|
private static final boolean FORCE_ALL = false;
|
||||||
private static final String LIB_NAME = "loader3d";
|
private static final String LIB_NAME = "loader3d";
|
||||||
private static final String LIB_NAME_DRAW = Logger.getDrawableName(Log.LIB_NAME);
|
private static final String LIB_NAME_DRAW = Logger.getDrawableName(Log.LIB_NAME);
|
||||||
private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.CRITICAL);
|
private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.CRITICAL);
|
||||||
@ -16,51 +16,58 @@ public class Log {
|
|||||||
private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.VERBOSE);
|
private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.VERBOSE);
|
||||||
private static final boolean PRINT_WARNING = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.WARNING);
|
private static final boolean PRINT_WARNING = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.WARNING);
|
||||||
|
|
||||||
public static void critical(final String data) {
|
public static void critical(final Exception e, final String data) {
|
||||||
if (Log.PRINT_CRITICAL || FORCE_DISPLAY) {
|
e.printStackTrace();
|
||||||
Logger.critical(Log.LIB_NAME_DRAW, data);
|
if (PRINT_CRITICAL || FORCE_ALL) {
|
||||||
|
Logger.critical(LIB_NAME_DRAW, data + " : " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void debug(final String data) {
|
public static void critical(final String data, final Object... objects) {
|
||||||
if (Log.PRINT_DEBUG || FORCE_DISPLAY) {
|
if (PRINT_CRITICAL || FORCE_ALL) {
|
||||||
Logger.debug(Log.LIB_NAME_DRAW, data);
|
Logger.critical(LIB_NAME_DRAW, data, objects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void error(final String data) {
|
public static void debug(final String data, final Object... objects) {
|
||||||
if (Log.PRINT_ERROR || FORCE_DISPLAY) {
|
if (PRINT_DEBUG || FORCE_ALL) {
|
||||||
Logger.error(Log.LIB_NAME_DRAW, data);
|
Logger.debug(LIB_NAME_DRAW, data, objects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void info(final String data) {
|
public static void error(final String data, final Object... objects) {
|
||||||
if (Log.PRINT_INFO || FORCE_DISPLAY) {
|
if (PRINT_ERROR || FORCE_ALL) {
|
||||||
Logger.info(Log.LIB_NAME_DRAW, data);
|
Logger.error(LIB_NAME_DRAW, data, objects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void print(final String data) {
|
public static void info(final String data, final Object... objects) {
|
||||||
if (Log.PRINT_PRINT || FORCE_DISPLAY) {
|
if (PRINT_INFO || FORCE_ALL) {
|
||||||
Logger.print(Log.LIB_NAME_DRAW, data);
|
Logger.info(LIB_NAME_DRAW, data, objects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void todo(final String data) {
|
public static void print(final String data, final Object... objects) {
|
||||||
if (Log.PRINT_TODO || FORCE_DISPLAY) {
|
if (PRINT_PRINT || FORCE_ALL) {
|
||||||
Logger.todo(Log.LIB_NAME_DRAW, data);
|
Logger.print(LIB_NAME_DRAW, data, objects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void verbose(final String data) {
|
public static void todo(final String data, final Object... objects) {
|
||||||
if (Log.PRINT_VERBOSE || FORCE_DISPLAY) {
|
if (PRINT_TODO || FORCE_ALL) {
|
||||||
Logger.verbose(Log.LIB_NAME_DRAW, data);
|
Logger.todo(LIB_NAME_DRAW, data, objects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void warning(final String data) {
|
public static void verbose(final String data, final Object... objects) {
|
||||||
if (Log.PRINT_WARNING || FORCE_DISPLAY) {
|
if (PRINT_VERBOSE || FORCE_ALL) {
|
||||||
Logger.warning(Log.LIB_NAME_DRAW, data);
|
Logger.verbose(LIB_NAME_DRAW, data, objects);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void warning(final String data, final Object... objects) {
|
||||||
|
if (PRINT_WARNING || FORCE_ALL) {
|
||||||
|
Logger.warning(LIB_NAME_DRAW, data, objects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user