Add 'DEBUG' LogType and Log::debug function

This commit is contained in:
2025-10-25 03:19:10 +01:00
parent abd4597f69
commit 2ed1763b83
2 changed files with 7 additions and 1 deletions

View File

@@ -29,7 +29,8 @@ public final class Log {
Map.of(
LogType.SUCCESS, Colours.GREEN,
LogType.ERROR, Colours.RED,
LogType.WARNING, Colours.PURPLE));
LogType.WARNING, Colours.PURPLE,
LogType.DEBUG, Colours.WHITE));
public static void error(String errorStage, String 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));
}
public static void debug(String debugMessage) {
System.out.println(formatString(LogType.DEBUG, "DEBUG", debugMessage));
}
private static String formatString(LogType logType, String stage, String description) {
String formattedType = String.format("[%s]", colouriseString(logType, logType.toString()));
String formattedStage = colouriseString(Colours.YELLOW, String.format("<%s>", stage));

View File

@@ -4,4 +4,5 @@ public enum LogType {
SUCCESS,
WARNING,
ERROR,
DEBUG,
}