|
|
|
@ -34,17 +34,21 @@ public class Logger {
|
|
|
|
|
* @param text Text to log
|
|
|
|
|
*/
|
|
|
|
|
public void write(String text, LogLevel logLevel) {
|
|
|
|
|
String colorize = "\u001B[0";
|
|
|
|
|
String msg = "[" + new Timestamp(System.currentTimeMillis()) + "] " + text + "\n";
|
|
|
|
|
String level = null;
|
|
|
|
|
switch (logLevel) {
|
|
|
|
|
case Error:
|
|
|
|
|
level = "[Error]";
|
|
|
|
|
colorize = "\u001B[31m"; // RED
|
|
|
|
|
break;
|
|
|
|
|
case Info:
|
|
|
|
|
level = "[Info]";
|
|
|
|
|
colorize = "\u001B[32m"; // GREEN
|
|
|
|
|
break;
|
|
|
|
|
case Warning:
|
|
|
|
|
level = "[Warning]";
|
|
|
|
|
colorize = "\u001B[33m"; // YELLOW
|
|
|
|
|
break;
|
|
|
|
|
case Action:
|
|
|
|
|
level = "[Action]";
|
|
|
|
@ -64,7 +68,7 @@ public class Logger {
|
|
|
|
|
case Warning:
|
|
|
|
|
case Debug:
|
|
|
|
|
default:
|
|
|
|
|
System.err.println(text);
|
|
|
|
|
System.err.println(colorize + text + "\u001B[0m");
|
|
|
|
|
break;
|
|
|
|
|
case Action:
|
|
|
|
|
break;
|
|
|
|
|