logging

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithExtend

func WithExtend(extend string) func(logger *Logger)

func WithLogWriter

func WithLogWriter(writer io.Writer) func(logger *Logger)

func WithName

func WithName(name string) func(logger *Logger)

func WithNameSpacing

func WithNameSpacing(spacing int) func(logger *Logger)

func WithSeverity

func WithSeverity(level Level) func(logger *Logger)

func WithSeveritySpacing

func WithSeveritySpacing(spacing int) func(logger *Logger)

Types

type Level

type Level string
const (
	INFO    Level = "info"
	DEBUG   Level = "debug"
	WARNING Level = "warning"
	TRACE   Level = "trace"
)

type Logger

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

func NewLogger

func NewLogger(options ...func(*Logger)) *Logger

func (*Logger) Debug

func (l *Logger) Debug(format string, params ...any)

func (*Logger) Error

func (l *Logger) Error(err error, format string, params ...any)

func (*Logger) Fatal

func (l *Logger) Fatal(err error, format string, params ...any)

func (*Logger) IdDebug

func (l *Logger) IdDebug() bool

func (*Logger) IdTrace

func (l *Logger) IdTrace() bool

func (*Logger) Info

func (l *Logger) Info(format string, params ...any)

func (*Logger) InfoStruct

func (l *Logger) InfoStruct(format OutputFormat, obj any)

func (*Logger) Panic

func (l *Logger) Panic(err error, format string, params ...any)

func (*Logger) Trace

func (l *Logger) Trace(format string, params ...any)

func (*Logger) Warning

func (l *Logger) Warning(format string, params ...any)

type OutputFormat

type OutputFormat int
const (
	Json OutputFormat = iota
	Yaml
)

Jump to

Keyboard shortcuts

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