logger

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: BSD-3-Clause Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHandler added in v1.2.4

func AddHandler(hand func(*Record))

func Crit added in v1.2.4

func Crit(args ...interface{})

func Debug

func Debug(args ...interface{})

func Error

func Error(args ...interface{})

func Info

func Info(args ...interface{})

func Init

func Init(opts ...LoggerOption)

func Panic added in v1.2.4

func Panic(args ...interface{})

func Trace added in v1.2.4

func Trace(args ...interface{})

func Warn

func Warn(args ...interface{})

Types

type Entry

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

func WithFields

func WithFields(fields Fields) *Entry

func (*Entry) Crit added in v1.2.4

func (e *Entry) Crit(args ...interface{})

func (*Entry) Debug

func (e *Entry) Debug(args ...interface{})

func (*Entry) Error

func (e *Entry) Error(args ...interface{})

func (*Entry) Info

func (e *Entry) Info(args ...interface{})

func (*Entry) Limit added in v1.2.3

func (e *Entry) Limit(dur time.Duration) *Entry

func (*Entry) Panic added in v1.2.4

func (e *Entry) Panic(args ...interface{})

func (*Entry) Trace added in v1.2.4

func (e *Entry) Trace(args ...interface{})

func (*Entry) Warn

func (e *Entry) Warn(args ...interface{})

type Fields

type Fields map[string]interface{}

type Level added in v1.2.4

type Level uint32
const (
	PanicLevel Level = 1
	CritLevel  Level = 2
	ErrorLevel Level = 3
	WarnLevel  Level = 4
	InfoLevel  Level = 5
	DebugLevel Level = 6
	TraceLevel Level = 7
)

type Logger added in v1.2.4

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

func New added in v1.2.4

func New(opts ...LoggerOption) *Logger

func (*Logger) AddHandler added in v1.2.4

func (l *Logger) AddHandler(hand func(*Record))

func (*Logger) Crit added in v1.2.4

func (l *Logger) Crit(args ...interface{})

func (*Logger) Debug added in v1.2.4

func (l *Logger) Debug(args ...interface{})

func (*Logger) Error added in v1.2.4

func (l *Logger) Error(args ...interface{})

func (*Logger) Info added in v1.2.4

func (l *Logger) Info(args ...interface{})

func (*Logger) Panic added in v1.2.4

func (l *Logger) Panic(args ...interface{})

func (*Logger) Trace added in v1.2.4

func (l *Logger) Trace(args ...interface{})

func (*Logger) Warn added in v1.2.4

func (l *Logger) Warn(args ...interface{})

func (*Logger) WithFields added in v1.2.4

func (l *Logger) WithFields(fields Fields) *Entry

type LoggerOption

type LoggerOption func(*Logger)

func SetIcons

func SetIcons(show bool) LoggerOption

func SetMaxLimit added in v1.2.4

func SetMaxLimit(dur time.Duration) LoggerOption

func SetTimeFormat

func SetTimeFormat(format string) LoggerOption

type Record added in v1.2.4

type Record struct {
	Level   Level
	Message string
	Time    time.Time
	Data    Fields
	// contains filtered or unexported fields
}

func (*Record) String added in v1.2.4

func (r *Record) String() string

func (*Record) StringColor added in v1.2.4

func (r *Record) StringColor() string

Jump to

Keyboard shortcuts

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