-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new classes to ezlib-simplelogger
- Loading branch information
Showing
5 changed files
with
94 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 1.0-ALPHA11 Changelog (WIP) | ||
|
||
## New modules | ||
|
||
### ezlib-downloader | ||
|
||
- Download a file to a directory. | ||
|
||
### ezlib-faster-spigot & ezlib-faster-paper | ||
|
||
A replacement for my BetterSpigotLib | ||
|
||
- Shortcut methods | ||
- example: | ||
- inRadius(entity/player/location, blocks) | ||
- inArea(firstLocation, secondLocation) | ||
- Easier handling of the api's | ||
|
||
## Changed modules | ||
|
||
### ezlib-simplelogger | ||
|
||
- Added Message-Class for better creating messages. | ||
- Changed LoggerColor from class to enum. | ||
- Added ILoggerColor Interface for custom LoggerColor classes. | ||
|
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
5 changes: 5 additions & 0 deletions
5
ezlib-simplelogger/src/main/java/de/eztxm/ezlib/simplelogger/color/ILoggerColor.java
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package de.eztxm.ezlib.simplelogger.color; | ||
|
||
public interface ILoggerColor { | ||
String getColorCode(); | ||
} |
31 changes: 21 additions & 10 deletions
31
ezlib-simplelogger/src/main/java/de/eztxm/ezlib/simplelogger/color/LoggerColor.java
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,24 @@ | ||
package de.eztxm.ezlib.simplelogger.color; | ||
|
||
public class LoggerColor { | ||
public static final String ANSI_RESET = "\u001B[0m"; | ||
public static final String ANSI_BLACK = "\u001B[30m"; | ||
public static final String ANSI_RED = "\u001B[31m"; | ||
public static final String ANSI_GREEN = "\u001B[32m"; | ||
public static final String ANSI_YELLOW = "\u001B[33m"; | ||
public static final String ANSI_BLUE = "\u001B[34m"; | ||
public static final String ANSI_PURPLE = "\u001B[35m"; | ||
public static final String ANSI_CYAN = "\u001B[36m"; | ||
public static final String ANSI_WHITE = "\u001B[37m"; | ||
public enum LoggerColor implements ILoggerColor { | ||
ANSI_RESET("\u001B[0m"), | ||
ANSI_BLACK("\u001B[30m"), | ||
ANSI_RED("\u001B[31m"), | ||
ANSI_GREEN("\u001B[32m"), | ||
ANSI_YELLOW("\u001B[33m"), | ||
ANSI_BLUE("\u001B[34m"), | ||
ANSI_PURPLE("\u001B[35m"), | ||
ANSI_CYAN("\u001B[36m"), | ||
ANSI_WHITE("\u001B[37m"); | ||
|
||
public final String colorCode; | ||
|
||
LoggerColor(String colorCode) { | ||
this.colorCode = colorCode; | ||
} | ||
|
||
@Override | ||
public String getColorCode() { | ||
return colorCode; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
ezlib-simplelogger/src/main/java/de/eztxm/ezlib/simplelogger/message/Message.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package de.eztxm.ezlib.simplelogger.message; | ||
|
||
import de.eztxm.ezlib.simplelogger.color.ILoggerColor; | ||
|
||
public class Message { | ||
private final StringBuilder builder; | ||
|
||
public Message() { | ||
this.builder = new StringBuilder(); | ||
} | ||
|
||
public Message(String input) { | ||
this.builder = new StringBuilder(input); | ||
} | ||
|
||
public Message append(String input) { | ||
this.builder.append(input); | ||
return this; | ||
} | ||
|
||
public Message append(Object input) { | ||
this.builder.append(input); | ||
return this; | ||
} | ||
|
||
public Message appendColor(ILoggerColor loggerColor) { | ||
this.builder.append(loggerColor.getColorCode()); | ||
return this; | ||
} | ||
|
||
public String asString() { | ||
return builder.toString(); | ||
} | ||
} |