Skip to main content

Module logger

Module logger 

Source
Expand description

Color detection and ANSI formatting for plain-text loggers.

Provides detect_color_support to check environment variables for color capability, and colorize to conditionally wrap text in ANSI escape codes.

For the ANSI color constants themselves, use crate::palette::ansi directly (e.g. crate::palette::ansi::GREEN).

Functionsยง

colorize
Wrap text with an ANSI color code if enabled is true.
detect_color_support
Detect if the terminal supports ANSI colors.