Package com.github.m4schini.FancyLog
Class Log
- java.lang.Object
-
- com.github.m4schini.FancyLog.Log
-
public class Log extends Object
Super simple library for super easy console logging- Author:
- m4schini MIT License Copyright (c) 2019 Malte Schink (malteschink.de)
-
-
Constructor Summary
Constructors Constructor Description Log()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcritical(Object input)Prints input with red background, timestamp and "CRITICAL: " at the startstatic voiddivide()Prints dashed line to consolestatic voidenableLog(boolean enable)Turn logging to console on or offstatic voiderror(Object input)Prints input in red with timestamp and "Error: " at the startstatic voidexception(Exception exception)Prints error, location and causestatic voidloading(int part)Prints a loadingbar to console.static voidsetTimestampPattern(String pattern)static voidstatus(Object input)Prints input with timestampstatic voidsuccess(Object input)Prints input in green with timestampstatic voidwarning(Object input)Prints input in yelloq with timestamp and "Warning: " at the start
-
-
-
Method Detail
-
enableLog
public static void enableLog(boolean enable)
Turn logging to console on or off- Parameters:
enable- true = on | false = off
-
status
public static void status(Object input)
Prints input with timestamp- Parameters:
input- content of console output
-
success
public static void success(Object input)
Prints input in green with timestamp- Parameters:
input- content of console output
-
error
public static void error(Object input)
Prints input in red with timestamp and "Error: " at the start- Parameters:
input- content of console output
-
warning
public static void warning(Object input)
Prints input in yelloq with timestamp and "Warning: " at the start- Parameters:
input- content of console output
-
critical
public static void critical(Object input)
Prints input with red background, timestamp and "CRITICAL: " at the start- Parameters:
input- content of console output
-
exception
public static void exception(Exception exception)
Prints error, location and cause- Parameters:
exception- thrown exception
-
divide
public static void divide()
Prints dashed line to console
-
setTimestampPattern
public static void setTimestampPattern(String pattern)
-
loading
public static void loading(int part)
Prints a loadingbar to console. You can have a maximun of 10 10%-steps. If you have to abort the loading process input -1 or you have to print \n before the next line of output- Parameters:
part- 0-10 = 10% Steps | -1 = abort
-
-