Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major improvements to the terminal experience
Terminal users rejoice! By updating to Jline 3 we've improved the user experience and gotten rid of the conflicts that were causing bugs and inconsistencies with terminal logging.
- Loading branch information
Showing
13 changed files
with
183 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,52 @@ | ||
package net.ME1312.Galaxi.Library.Log; | ||
|
||
import org.fusesource.jansi.Ansi; | ||
|
||
/** | ||
* Log Level Enum | ||
*/ | ||
public enum LogLevel { | ||
DEBUG, | ||
MESSAGE, | ||
INFO, | ||
WARN, | ||
ERROR, | ||
SEVERE, | ||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.