logging

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogWriter

func NewLogWriter(w io.Writer, colors LogColors) io.Writer

NewLogWriter wraps w with a writer that colorizes logrus-formatted lines. Pass a zero LogColors to disable colorization.

func Setup

func Setup(w io.Writer, level string)

Setup initializes and configures the global logger with colorized logging

Types

type LogColors

type LogColors struct {
	Debug   string // debug level
	Info    string // info level
	Warning string // warning level
	Error   string // error level
	Message string // msg value — bright/white
	Gray    string // timestamps, keys, and field values
	Reset   string // reset all attributes
}

LogColors holds ANSI escape sequences used to colorize logrus-formatted log output.

func DefaultLogColors

func DefaultLogColors() LogColors

DefaultLogColors returns the default color scheme for logrus-formatted log output, consistent with the progress and slog color palettes.

type TintFormatter

type TintFormatter struct {
	// TimeFormat controls the timestamp layout (default: time.DateTime).
	TimeFormat string
}

TintFormatter is a logrus Formatter that produces output identical to the tint slog handler, so logrus-based libraries blend in with slog output.

func (*TintFormatter) Format

func (f *TintFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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