Skip to content

Commit

Permalink
added support for older versions of JANSI
Browse files Browse the repository at this point in the history
  • Loading branch information
slowcheet4h committed May 8, 2022
1 parent d9c3277 commit 74335ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
15 changes: 2 additions & 13 deletions pisi/unitedmeows/yystal/logger/impl/YLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,8 @@ public class YLogger implements ILogger {
private String[] buffer;
private boolean colored = false;
private int bufferIndex;
private static final Ansi.Color FATAL_COLOR;

static {
final String os = System.getProperty("os.name").toLowerCase();
boolean linux = (os.contains("nix") || os.contains("nux") || os.contains("aix"));
if (linux) {
FATAL_COLOR = Ansi.Color.MAGENTA;
} else {
FATAL_COLOR = Ansi.Color.RED;
/* todo: ghost check this (on linux MAGENTA makes RED background im not sure if it's same for windows)*/
}
}

private static final Ansi.Color FATAL_COLOR = Ansi.Color.RED;

public YLogger(final Class<?> _clazz) {
clazz = _clazz;
name = "[" + clazz.getSimpleName().toUpperCase(Locale.ROOT) + "]";
Expand Down
6 changes: 4 additions & 2 deletions test/yystal/YTestStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ public enum YTestStart {
private static final YLogger logger = YYStal.createLogger(YTestStart.class).setTime(YLogger.Time.DAY_MONTH_YEAR_FULL).setColored(true);

public static void main(final String[] args) {

logger.fatal("ez");
logger.info("ez");
logger.debug("ez");
if (true) {
new YWindow(":DDDDDDDD", 800, 800).open();

return;
}

Expand Down

0 comments on commit 74335ef

Please sign in to comment.