logger

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color func() PrintFunc

type Logger

type Logger struct {
	Stdout  io.Writer
	Stderr  io.Writer
	Verbose bool
	Color   bool
}

Logger is a wrapper that prints stuff to STDOUT or STDERR, with optional color and verbosity.

func NewLogger

func NewLogger(verbose, useColor bool) *Logger

NewLogger creates a new Logger instance.

func (*Logger) Errf

func (l *Logger) Errf(c Color, s string, args ...any)

Errf prints stuff to STDERR.

func (*Logger) Errorf

func (l *Logger) Errorf(s string, args ...any)

Errorf prints an error message to STDERR.

func (*Logger) FOutf

func (l *Logger) FOutf(w io.Writer, c Color, s string, args ...any)

FOutf prints stuff to the given writer.

func (*Logger) Infof

func (l *Logger) Infof(s string, args ...any)

Infof prints an informational message to STDOUT.

func (*Logger) Outf

func (l *Logger) Outf(c Color, s string, args ...any)

Outf prints stuff to STDOUT.

func (*Logger) Plainf

func (l *Logger) Plainf(s string, args ...any)

Plainf prints a plain message to STDOUT.

func (*Logger) VerboseErrf

func (l *Logger) VerboseErrf(c Color, s string, args ...any)

VerboseErrf prints stuff to STDERR if verbose mode is enabled.

func (*Logger) VerboseOutf

func (l *Logger) VerboseOutf(c Color, s string, args ...any)

VerboseOutf prints stuff to STDOUT if verbose mode is enabled.

func (*Logger) Warnf

func (l *Logger) Warnf(s string, args ...any)

Warnf prints a warning message to STDERR.

type PrintFunc

type PrintFunc func(io.Writer, string, ...any)

func Blue

func Blue() PrintFunc

func Cyan

func Cyan() PrintFunc

func Default

func Default() PrintFunc

func Green

func Green() PrintFunc

func Magenta

func Magenta() PrintFunc

func None

func None() PrintFunc

func Red

func Red() PrintFunc

func Yellow

func Yellow() PrintFunc

Jump to

Keyboard shortcuts

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