log

package
v0.0.0-...-14dca07 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorOutput = NewLevelWriter(generalOutput, ErrorLevel)
	DebugOutput = NewLevelWriter(generalOutput, DebugLevel)
	InfoOutput  = NewLevelWriter(generalOutput, InfoLevel)
)
View Source
var DefaultOutputConfig = OutputConfig{
	LogLevel: InfoLevel,
	Colors:   true,
}

Functions

func Configure

func Configure(config OutputConfig)

func Debug

func Debug(params ...any)

func Debugf

func Debugf(message string, params ...any)

func DumpError

func DumpError(_ error)

func Error

func Error(params ...any)

func Errorf

func Errorf(message string, params ...any)

func Info

func Info(params ...any)

func Infof

func Infof(message string, params ...any)

func SetOutput

func SetOutput(output io.Writer)

func Stdout

func Stdout() io.Writer

Types

type Level

type Level int
const (
	DebugLevel Level = iota
	InfoLevel
	ErrorLevel
	NoneLevel
)

type LevelWriter

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

func NewLevelWriter

func NewLevelWriter(output io.Writer, expected Level) *LevelWriter

func (*LevelWriter) SetLevel

func (wr *LevelWriter) SetLevel(level Level)

func (*LevelWriter) SetOutput

func (wr *LevelWriter) SetOutput(output io.Writer)

func (*LevelWriter) Write

func (wr *LevelWriter) Write(p []byte) (n int, err error)

type OutputConfig

type OutputConfig struct {
	LogLevel Level
	Colors   bool
}

func (*OutputConfig) UnmarshalYAML

func (c *OutputConfig) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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