Include lines inside build.gradle:
repositories {
...
maven { url "https://www.jitpack.io" }
}
dependencies {
...
implementation 'com.github.MrNadimi:ConsoleLogger:1.0.2'
}
Just create a log object
private static final Log LOG = Log.getLogger(MainClass.class);
Now log with your own level
LOG.debug("Hi java Console Logger" );
LOG.warn("Hi java Console Logger" );
LOG.error("Hi java Console Logger" );
LOG.trace("Hi java Console Logger" );
LOG.info("Hi java Console Logger" );
By default the log String is not colored
When you want to log with ansi colors, just add this line on Log class
//add setWithAnsi(true)
private static final Log LOG = Log.getLogger(MainClass.class).setWithAnsi(true);
- You cant change the log pattern
- This project cant save logs in file
- This project is very light and just for console printing
This lib using JColor for print Ansi colores on console