logging

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureStandardLogger

func ConfigureStandardLogger(opts Options)

Types

type Entry

type Entry struct {
	Component string
	Phase     string
	Level     string
}

type Format

type Format string
const (
	FormatAuto  Format = "auto"
	FormatPlain Format = "plain"
	FormatRich  Format = "rich"
)

func ParseFormat

func ParseFormat(raw string) (Format, error)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func Component

func Component(name string) Logger

func (Logger) Errorf

func (l Logger) Errorf(format string, args ...any)

func (Logger) Infof

func (l Logger) Infof(format string, args ...any)

func (Logger) Level

func (l Logger) Level(level string) Logger

func (Logger) Phase

func (l Logger) Phase(phase string) Logger

func (Logger) Printf

func (l Logger) Printf(format string, args ...any)

func (Logger) Warnf

func (l Logger) Warnf(format string, args ...any)

type Options

type Options struct {
	Writer     io.Writer
	Format     Format
	ForceColor bool
	NoColor    bool
	IsTTY      bool
	Theme      Theme
}

type Theme

type Theme struct {
	Timestamp  string
	Component  string
	Warning    string
	Error      string
	PhaseColor map[string]string
}

func DefaultTheme

func DefaultTheme() Theme

func ThemeFromPalette

func ThemeFromPalette(palette *palettes.Palette) Theme

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(opts Options) *Writer

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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