Documentation
¶
Overview ¶
Package log provides a simple logging interface with ANSI color support for terminal output. It allows for colored output to stdout and stderr, making it easier to distinguish between different types of messages. The package includes functions for printing plain, success, and error messages with optional formatting.
Index ¶
Examples ¶
Constants ¶
View Source
const ( AnsiNone ansiCode = "" AnsiReset ansiCode = "0" AnsiRed ansiCode = "31" AnsiGreen ansiCode = "32" ArgsFormatSpecifier string = "%[]" )
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(args ...any)
Example ¶
oldStderr := os.Stderr
os.Stderr = os.Stdout
defer func() { os.Stderr = oldStderr }()
Error("Goodbye", " ", "World!")
Output: ✗ Goodbye World!
func Errorf ¶
Example ¶
oldStderr := os.Stderr
os.Stderr = os.Stdout
defer func() { os.Stderr = oldStderr }()
Errorf("Goodbye %s!", "World")
Output: ✗ Goodbye World!
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.