A lightweight Java ANSI color logger for styled and beautifully formatted CLI output.
✨ Color Support
- Support for 7 ANSI colors (Red, Green, Yellow, Blue, Purple, Cyan, White)
🎯 Log Levels
info()- Blue informational messagessuccess()- Green success messageserror()- Red error messageswarn()- Yellow warning messagessys()- Purple system messageslog()- White general messages
📦 Formatting
- Section headers with decorative borders
- Horizontal dividers
- Unicode symbols (✔, ✖, ⚠, ℹ, ⚙)
- Screen clearing
- Typing animation effects
Add to your pom.xml:
<dependency>
<groupId>com.laz4rd</groupId>
<artifactId>fansi-logger</artifactId>
<version>1.0.0</version>
</dependency>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/laz4rd/FANSI-Logger</url>
</repository>import com.laz4rd.fansi.Logger;
public class Main {
public static void main(String[] args) {
// Log messages
Logger.info("This is an info message");
Logger.success("Operation completed successfully");
Logger.error("An error occurred");
Logger.warn("This is a warning");
Logger.sys("System message");
// Section headers
Logger.section("MY APPLICATION");
// Dividers
Logger.divider();
// Clear screen
Logger.clear();
// Typing animation
Logger.type("Hello, World!", 50);
}
}[ℹ INFO] This is an info message
[✔ SUCCESS] Operation completed successfully
[✖ ERROR] An error occurred
[⚠ WARN] This is a warning
[⚙ SYS] System message
- Java 11 or higher
- No external dependencies
MIT License - See LICENSE file for details
