Skip to content

laz4rd/FANSI-Logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


FANSI Logger

A lightweight Java ANSI color logger for styled and beautifully formatted CLI output.

Features

Color Support

  • Support for 7 ANSI colors (Red, Green, Yellow, Blue, Purple, Cyan, White)

🎯 Log Levels

  • info() - Blue informational messages
  • success() - Green success messages
  • error() - Red error messages
  • warn() - Yellow warning messages
  • sys() - Purple system messages
  • log() - White general messages

📦 Formatting

  • Section headers with decorative borders
  • Horizontal dividers
  • Unicode symbols (✔, ✖, ⚠, ℹ, ⚙)
  • Screen clearing
  • Typing animation effects

Installation

Maven

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>

Usage

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);
    }
}

Example Output

[ℹ INFO] This is an info message
[✔ SUCCESS] Operation completed successfully
[✖ ERROR] An error occurred
[⚠ WARN] This is a warning
[⚙ SYS] System message

Requirements

  • Java 11 or higher
  • No external dependencies

License

MIT License - See LICENSE file for details

Author

laz4rd

About

A Fancy Java ANSI color logger for styled CLI output with colors, icons, and formatting

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages