log

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrWrapper added in v0.0.34

func ErrWrapper(err Err) error

Types

type Err added in v0.0.34

type Err int
const (
	UnknownErrCode Err = iota
	IllegalParams
	IllegalKeyType
)

func (Err) String added in v0.0.34

func (i Err) String() string

type Level added in v0.0.34

type Level int64
const (
	UnknownLevel Level = iota
	Dummy
	Debug
	Info
	Warn
	Error
)

func (Level) String added in v0.0.34

func (i Level) String() string

type Log added in v0.0.52

type Log interface {
	Debugf(template string, args ...any)
	Debugw(msg string, keysAndValues ...interface{})
	Infof(template string, args ...any)
	Infow(msg string, keysAndValues ...interface{})
	Warnf(template string, args ...any)
	Warnw(msg string, keysAndValues ...interface{})
	Errorf(template string, args ...any)
	Errorw(msg string, keysAndValues ...interface{})
}

func NewLogger

func NewLogger(opts ...OptionFunc) (Log, error)

type OptionFunc added in v0.0.46

type OptionFunc func(*config)

func WithCaller added in v0.0.44

func WithCaller(caller bool, callerSkip int) OptionFunc

func WithConsole

func WithConsole(console bool) OptionFunc

func WithFileName

func WithFileName(fileName string) OptionFunc

func WithLevel

func WithLevel(level string) OptionFunc

func WithMaxAge

func WithMaxAge(maxAge int) OptionFunc

func WithMaxBackups

func WithMaxBackups(maxBackups int) OptionFunc

func WithMaxSize

func WithMaxSize(maxSize int) OptionFunc

Jump to

Keyboard shortcuts

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