package client.log; import java.io.PrintStream; public class EventLogger { private static final String ANSI_RESET = "\u001B[0m"; private static final String ANSI_RED = "\u001B[31m"; private static final String ANSI_GREEN = "\u001B[32m"; private static final String ANSI_BLUE = "\u001B[34m"; private static final String ANSI_WHITE = "\u001B[37m"; private final PrintStream stream; public EventLogger(PrintStream stream) { this.stream = stream; } public void println(String msg) { stream.println(msg); } public void error(String msg) { stream.println(ANSI_WHITE + "[" + ANSI_RED + "-" + ANSI_WHITE + "] " + msg + ANSI_RESET); } public void info(String msg) { stream.println(ANSI_WHITE + "[" + ANSI_BLUE + "*" + ANSI_WHITE + "] " + msg + ANSI_RESET); } public void success(String msg) { stream.println(ANSI_WHITE + "[" + ANSI_GREEN + "+" + ANSI_WHITE + "] " + msg + ANSI_RESET); } public void close() { stream.close(); } }