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
textwith an ANSI color code ifenabledis true. - detect_
color_ support - Detect if the terminal supports ANSI colors.