improved logging in windows
This commit is contained in:
parent
797d29281b
commit
98e14b92ab
@ -52,7 +52,9 @@ public class Log {
|
|||||||
|
|
||||||
|
|
||||||
public static void log(String msg, int level) {
|
public static void log(String msg, int level) {
|
||||||
|
boolean iswindows = System.getProperty("os.name").contains("Windows");
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
if (!iswindows){
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case INFO:
|
case INFO:
|
||||||
builder.append(ANSI_CYAN);
|
builder.append(ANSI_CYAN);
|
||||||
@ -73,6 +75,8 @@ public class Log {
|
|||||||
builder.append(ANSI_BLUE);
|
builder.append(ANSI_BLUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
builder.append("[");
|
builder.append("[");
|
||||||
builder.append(calcDate(System.currentTimeMillis()));
|
builder.append(calcDate(System.currentTimeMillis()));
|
||||||
builder.append("]");
|
builder.append("]");
|
||||||
@ -85,11 +89,16 @@ public class Log {
|
|||||||
builder.append(colors.get(level));
|
builder.append(colors.get(level));
|
||||||
builder.append("]");
|
builder.append("]");
|
||||||
|
|
||||||
|
if (!iswindows){
|
||||||
builder.append(ANSI_WHITE);
|
builder.append(ANSI_WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
builder.append(" - ");
|
builder.append(" - ");
|
||||||
builder.append(msg);
|
builder.append(msg);
|
||||||
|
|
||||||
|
if (!iswindows){
|
||||||
builder.append(ANSI_RESET);
|
builder.append(ANSI_RESET);
|
||||||
|
}
|
||||||
System.out.println(builder.toString());
|
System.out.println(builder.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user