class Logit::Formatter::Human

Overview

Human-readable formatter with colorized output.

Produces output optimized for terminal viewing during development. Includes ANSI color codes for log levels and uses a compact, readable format.

Output Format

HH:MM:SS.mmm LEVEL Class#method (duration) → return_value  file.cr:line
    args: arg1=value1, arg2=value2

Example Output

10:30:45.123 INFO  UserService#find_user (2ms) → User{id: 42}  user_service.cr:15
    args: id=42
10:30:45.125 ERROR PaymentService#charge (15ms)  payment_service.cr:42
    args: amount=99.99PaymentError: Card declined

Color Coding

Defined in:

logit/formatters/human.cr

Instance Method Summary

Instance methods inherited from class Logit::Formatter

format(event : Event) : String format

Instance Method Detail

def format(event : Event) : String #

Formats an event into a human-readable string with ANSI colors.


[View source]