-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Minecraftian14/Update-LambdasAndFile
Update lambdas and file
- Loading branch information
Showing
47 changed files
with
1,461 additions
and
654 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,79 @@ | ||
# Umm, complete documentation? | ||
|
||
### Initialisation | ||
|
||
``` | ||
// Default initialisation, prints to System.out | ||
FLog logger = FLog.getNew(); | ||
// Prepares and provides the formatted log text to the given object. | ||
// The object can be an OutputStream, a ByteConsumer or a StringsConsumer. | ||
FLog logger = FLog.getNew(object); | ||
// The same initialisation methods are followed by ALog | ||
FLog logger = ALog.getNew(); | ||
FLog logger = ALog.getNew(object); | ||
// To write logs to to a file "Hello.txt". | ||
FLog logger = FileLog.getNew("Hello.txt"); | ||
// or | ||
FLog logger = FileLog.getNew(new File("logs/Hello.txt")); | ||
// To write logs to a file with a default name. | ||
FLog logger = FileLog.getNew(); | ||
// To use a custom Decoration | ||
log.setDecorationType(Decorations.TAG); // enable tag decos. | ||
log.setDecorationType(Decorations.RAW); // enable raw decos, ie, no strange characters. | ||
// creating a logger to both, print to console and write to file. | ||
FLog log = ULog.forNew() | ||
.add(FLog.getNew()) | ||
.add(FileLog.getNew("new.txt")) | ||
.create(); | ||
// When using ConsoleDecoration, to set the color mode. | ||
ConsoleDecoration.setColorMode(mode); | ||
// mode can be one of [NONE, BLACK, WHITE, BIT_3, BIT_4, BIT_8, TRUE_COLOR_BIT_24] | ||
``` | ||
|
||
#### Usage | ||
|
||
``` | ||
// Print formatted text | ||
// the arguments can be strings or objects. | ||
logger.prt(arg1, arg2, arg3 ... argn); | ||
// Print unformatted text | ||
logger.raw(arg); | ||
// Print with a custom format | ||
logger.prtf(format1, format2...).consume(arg1, arg2, arg3...); | ||
// To set a specific decoration type | ||
logger.setDecorationType(name); | ||
// name can be one of Decorations.[CONSOLE, RAW, TAG, EMPTY] | ||
// To print a cluster of data at once, you may prepare a packet | ||
Packet pack = logger.newPacket(); | ||
pack.prt(...); | ||
pack.raw(...); | ||
pack.consume(); | ||
// To use log levels | ||
logger.general().prt(() -> new String[]{"General", "Hello", "World"}); | ||
// or | ||
LogLevel.DEBUG.act(() -> log.prt("General", "Hello", "World")); | ||
// To set a log level | ||
LogLevel.setLevel(LogLevel.WARN); | ||
// or | ||
LogLevel.NOTICE.activate(); | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ jar { | |
from { | ||
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } | ||
} | ||
} | ||
} |
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.