log

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package log provides zero-dependency colored terminal output.

Index

Constants

View Source
const (
	Reset     = "\x1b[0m"
	Bold      = "\x1b[1m"
	Dim       = "\x1b[2m"
	Underline = "\x1b[4m"

	// 256-color: amber accent (#fbbf24)
	FgAmber   = "\x1b[38;5;214m"
	BoldAmber = "\x1b[1;38;5;214m"

	// Standard colors
	BoldGreen   = "\x1b[1;32m"
	BoldRed     = "\x1b[1;31m"
	BoldYellow  = "\x1b[1;38;5;220m"
	BoldWhite   = "\x1b[1;37m"
	BoldBlue    = "\x1b[1;34m"
	BoldMagenta = "\x1b[1;35m"
	FgWhite     = "\x1b[37m"
	FgDim       = "\x1b[38;5;245m"
)

ANSI escape codes - LeakIX-inspired amber palette.

Variables

This section is empty.

Functions

func Amber

func Amber(s string) string

func Blue

func Blue(s string) string

func BoldText

func BoldText(s string) string

func Debug

func Debug(format string, args ...any)

func DimText

func DimText(s string) string

func Error

func Error(format string, args ...any)

func Green

func Green(s string) string

func Muted

func Muted(s string) string

func Output added in v0.3.0

func Output() io.Writer

Output returns the current output writer.

func Pad

func Pad(s string, width int) string

Pad right-pads a (possibly ANSI-colored) string to width based on visual length.

func Red

func Red(s string) string

func SetOutput added in v0.3.0

func SetOutput(w io.Writer)

SetOutput changes the output writer (defaults to os.Stderr).

func Status

func Status(format string, args ...any)

func Style

func Style(code, text string) string

func Success

func Success(format string, args ...any)

func UnderlineText

func UnderlineText(s string) string

func Verbose

func Verbose(format string, args ...any)

func VisualLen

func VisualLen(s string) int

VisualLen returns the display width of a string, ignoring ANSI codes.

func Warning

func Warning(format string, args ...any)

func White

func White(s string) string

func Yellow

func Yellow(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL