You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Default initialisation, prints to System.outFLog 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 ALogFLog logger =ALog.getNew();
FLog logger =ALog.getNew(object);
// To write logs to to a file "Hello.txt".FLog logger =FileLog.getNew("Hello.txt");
// orFLog logger =FileLog.getNew(newFile("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();
// Creating a logger to run on a separate Thread// where logger is another instance of FLogFLog log =LateLog.getNew(logger);
// Other ways, to customise it further// where logger is another instance of FLog // and executorService is an instance of ExecutorServiceFLog log =LateLog.getNew(
executorService,
logger
);
// 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 packetPacket pack = logger.newPacket();
pack.prt(...);
pack.raw(...);
pack.consume();
// To use log levels
logger.general().prt(() ->newString[]{"General", "Hello", "World"});
// orLogLevel.DEBUG.act(() -> log.prt("General", "Hello", "World"));
// LogLevel can also be used in other places, to do some action if required.LogLevel.NOTICE.act(() -> someTask());
// To set a log levelLogLevel.setLevel(LogLevel.WARN);
// orLogLevel.NOTICE.activate();
// To check if a LogLevel is active/allowedif(LogLevel.ERROR.accepted()) {
// Some code
}