log

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 6 Imported by: 44

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGet added in v0.4.0

func MustGet[T any](value T, err error) func(l Logger) T

Types

type Fmt

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

func NewFmt

func NewFmt(opts ...FmtOption) *Fmt

func (*Fmt) Debug

func (l *Fmt) Debug(a ...interface{})

func (*Fmt) Debugf

func (l *Fmt) Debugf(format string, a ...interface{})

func (*Fmt) Error

func (l *Fmt) Error(a ...interface{})

func (*Fmt) Errorf

func (l *Fmt) Errorf(format string, a ...interface{})

func (*Fmt) Fatal

func (l *Fmt) Fatal(a ...interface{})

func (*Fmt) Fatalf

func (l *Fmt) Fatalf(format string, a ...interface{})

func (*Fmt) Info

func (l *Fmt) Info(a ...interface{})

func (*Fmt) Infof

func (l *Fmt) Infof(format string, a ...interface{})

func (*Fmt) IsLevel added in v0.1.2

func (l *Fmt) IsLevel(v Level) bool

func (*Fmt) Level

func (l *Fmt) Level() Level

func (*Fmt) Must

func (l *Fmt) Must(err error)

func (*Fmt) Named added in v0.1.2

func (l *Fmt) Named(name string) Logger

func (*Fmt) Print

func (l *Fmt) Print(a ...interface{})

func (*Fmt) Printf

func (l *Fmt) Printf(format string, a ...interface{})

func (*Fmt) SlogHandler added in v0.7.0

func (l *Fmt) SlogHandler() slog.Handler

func (*Fmt) Success added in v0.1.2

func (l *Fmt) Success(a ...interface{})

func (*Fmt) Successf added in v0.1.2

func (l *Fmt) Successf(format string, a ...interface{})

func (*Fmt) Trace added in v0.1.6

func (l *Fmt) Trace(a ...interface{})

func (*Fmt) Tracef added in v0.1.6

func (l *Fmt) Tracef(format string, a ...interface{})

func (*Fmt) Warn

func (l *Fmt) Warn(a ...interface{})

func (*Fmt) Warnf

func (l *Fmt) Warnf(format string, a ...interface{})

type FmtOption

type FmtOption func(*Fmt)

func FmtWithLevel

func FmtWithLevel(v Level) FmtOption

type Level

type Level int
const (
	LevelTrace Level = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
)

func GetLevel

func GetLevel(v string) Level

func (Level) String added in v0.1.2

func (l Level) String() string

type Logger

type Logger interface {
	Level() Level
	IsLevel(level Level) bool
	Named(name string) Logger
	Print(a ...interface{})
	Printf(format string, a ...interface{})
	Success(a ...interface{})
	Successf(format string, a ...interface{})
	Trace(a ...interface{})
	Tracef(format string, a ...interface{})
	Debug(a ...interface{})
	Debugf(format string, a ...interface{})
	Info(a ...interface{})
	Infof(format string, a ...interface{})
	Warn(a ...interface{})
	Warnf(format string, a ...interface{})
	Error(a ...interface{})
	Errorf(format string, a ...interface{})
	Fatal(a ...interface{})
	Fatalf(format string, a ...interface{})
	Must(err error)
	SlogHandler() slog.Handler
}

type PTerm

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

func NewPTerm

func NewPTerm(opts ...PTermOption) *PTerm

func (*PTerm) Debug

func (l *PTerm) Debug(a ...interface{})

func (*PTerm) Debugf

func (l *PTerm) Debugf(format string, a ...interface{})

func (*PTerm) Error

func (l *PTerm) Error(a ...interface{})

func (*PTerm) Errorf

func (l *PTerm) Errorf(format string, a ...interface{})

func (*PTerm) Fatal

func (l *PTerm) Fatal(a ...interface{})

func (*PTerm) Fatalf

func (l *PTerm) Fatalf(format string, a ...interface{})

func (*PTerm) Info

func (l *PTerm) Info(a ...interface{})

func (*PTerm) Infof

func (l *PTerm) Infof(format string, a ...interface{})

func (*PTerm) IsLevel added in v0.1.2

func (l *PTerm) IsLevel(v Level) bool

func (*PTerm) Level

func (l *PTerm) Level() Level

func (*PTerm) Must

func (l *PTerm) Must(err error)

func (*PTerm) Named added in v0.1.2

func (l *PTerm) Named(name string) Logger

func (*PTerm) Print

func (l *PTerm) Print(a ...interface{})

func (*PTerm) Printf

func (l *PTerm) Printf(format string, a ...interface{})

func (*PTerm) SlogHandler added in v0.7.0

func (l *PTerm) SlogHandler() slog.Handler

func (*PTerm) Success added in v0.1.2

func (l *PTerm) Success(a ...interface{})

func (*PTerm) Successf added in v0.1.2

func (l *PTerm) Successf(format string, a ...interface{})

func (*PTerm) Trace added in v0.1.6

func (l *PTerm) Trace(a ...interface{})

func (*PTerm) Tracef added in v0.1.6

func (l *PTerm) Tracef(format string, a ...interface{})

func (*PTerm) Warn

func (l *PTerm) Warn(a ...interface{})

func (*PTerm) Warnf

func (l *PTerm) Warnf(format string, a ...interface{})

type PTermOption

type PTermOption func(*PTerm)

func PTermWithDisableColor

func PTermWithDisableColor(v bool) PTermOption

func PTermWithLevel

func PTermWithLevel(v Level) PTermOption

type Test added in v0.3.0

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

func NewTest added in v0.3.0

func NewTest(t *testing.T, opts ...TestOption) *Test

func (*Test) Debug added in v0.3.0

func (l *Test) Debug(a ...interface{})

func (*Test) Debugf added in v0.3.0

func (l *Test) Debugf(format string, a ...interface{})

func (*Test) Error added in v0.3.0

func (l *Test) Error(a ...interface{})

func (*Test) Errorf added in v0.3.0

func (l *Test) Errorf(format string, a ...interface{})

func (*Test) Fatal added in v0.3.0

func (l *Test) Fatal(a ...interface{})

func (*Test) Fatalf added in v0.3.0

func (l *Test) Fatalf(format string, a ...interface{})

func (*Test) Info added in v0.3.0

func (l *Test) Info(a ...interface{})

func (*Test) Infof added in v0.3.0

func (l *Test) Infof(format string, a ...interface{})

func (*Test) IsLevel added in v0.3.0

func (l *Test) IsLevel(v Level) bool

func (*Test) Level added in v0.3.0

func (l *Test) Level() Level

func (*Test) Must added in v0.3.0

func (l *Test) Must(err error)

func (*Test) Named added in v0.3.0

func (l *Test) Named(name string) Logger

func (*Test) Print added in v0.3.0

func (l *Test) Print(a ...interface{})

func (*Test) Printf added in v0.3.0

func (l *Test) Printf(format string, a ...interface{})

func (*Test) SlogHandler added in v0.7.0

func (l *Test) SlogHandler() slog.Handler

func (*Test) Success added in v0.3.0

func (l *Test) Success(a ...interface{})

func (*Test) Successf added in v0.3.0

func (l *Test) Successf(format string, a ...interface{})

func (*Test) Trace added in v0.3.0

func (l *Test) Trace(a ...interface{})

func (*Test) Tracef added in v0.3.0

func (l *Test) Tracef(format string, a ...interface{})

func (*Test) Warn added in v0.3.0

func (l *Test) Warn(a ...interface{})

func (*Test) Warnf added in v0.3.0

func (l *Test) Warnf(format string, a ...interface{})

type TestOption added in v0.3.0

type TestOption func(*Test)

func TestWithLevel added in v0.3.0

func TestWithLevel(v Level) TestOption

Jump to

Keyboard shortcuts

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