Add 'DEBUG' LogType and Log::debug function
This commit is contained in:
@@ -29,7 +29,8 @@ public final class Log {
|
|||||||
Map.of(
|
Map.of(
|
||||||
LogType.SUCCESS, Colours.GREEN,
|
LogType.SUCCESS, Colours.GREEN,
|
||||||
LogType.ERROR, Colours.RED,
|
LogType.ERROR, Colours.RED,
|
||||||
LogType.WARNING, Colours.PURPLE));
|
LogType.WARNING, Colours.PURPLE,
|
||||||
|
LogType.DEBUG, Colours.WHITE));
|
||||||
|
|
||||||
public static void error(String errorStage, String errorDescription) {
|
public static void error(String errorStage, String errorDescription) {
|
||||||
System.out.println(formatString(LogType.ERROR, errorStage, errorDescription));
|
System.out.println(formatString(LogType.ERROR, errorStage, errorDescription));
|
||||||
@@ -43,6 +44,10 @@ public final class Log {
|
|||||||
System.out.println(formatString(LogType.WARNING, warningStage, warningDescription));
|
System.out.println(formatString(LogType.WARNING, warningStage, warningDescription));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void debug(String debugMessage) {
|
||||||
|
System.out.println(formatString(LogType.DEBUG, "DEBUG", debugMessage));
|
||||||
|
}
|
||||||
|
|
||||||
private static String formatString(LogType logType, String stage, String description) {
|
private static String formatString(LogType logType, String stage, String description) {
|
||||||
String formattedType = String.format("[%s]", colouriseString(logType, logType.toString()));
|
String formattedType = String.format("[%s]", colouriseString(logType, logType.toString()));
|
||||||
String formattedStage = colouriseString(Colours.YELLOW, String.format("<%s>", stage));
|
String formattedStage = colouriseString(Colours.YELLOW, String.format("<%s>", stage));
|
||||||
|
|||||||
@@ -4,4 +4,5 @@ public enum LogType {
|
|||||||
SUCCESS,
|
SUCCESS,
|
||||||
WARNING,
|
WARNING,
|
||||||
ERROR,
|
ERROR,
|
||||||
|
DEBUG,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user