/
LogLevel.java
52 lines (46 loc) · 1022 Bytes
/
LogLevel.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package net.ME1312.Galaxi.Library.Log;
import org.fusesource.jansi.Ansi;
/**
* Log Level Enum
*/
public enum LogLevel {
DEBUG(Ansi.ansi().fgBrightCyan()),
MESSAGE(Ansi.ansi().fgBrightBlack()),
INFO(),
SUCCESS(Ansi.ansi().fgBrightGreen()),
WARN(Ansi.ansi().fgBrightYellow()),
ERROR(Ansi.ansi().fgBrightRed()),
SEVERE(Ansi.ansi().fgBrightRed()),
;
private String name;
private Ansi color;
LogLevel() {
this(null, null);
}
LogLevel(String name) {
this(name, null);
}
LogLevel(Ansi color) {
this(null, color);
}
LogLevel(String name, Ansi color) {
this.name = (name != null)?name:toString();
this.color = color;
}
/**
* Get the name of this Log Level
*
* @return Level Name
*/
public String getName() {
return name;
}
/**
* Get the color of this Log Level
*
* @return Level Color
*/
public Ansi getColor() {
return color;
}
}