log

package
v0.0.0-...-4f0d0f2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatchAllLogHandlerFunc

type CatchAllLogHandlerFunc func(logLevel LogLevel, msg string, ctx ...interface{})

type LogHandler

type LogHandler struct {
	DebugHandler    LogHandlerFunc
	InfoHandler     LogHandlerFunc
	WarnHandler     LogHandlerFunc
	ErrorHandler    LogHandlerFunc
	FatalHandler    LogHandlerFunc
	CatchAllHandler CatchAllLogHandlerFunc
}

func NewStdOutHandler

func NewStdOutHandler(useLogLevel LogLevel) *LogHandler

type LogHandlerFunc

type LogHandlerFunc func(msg string, ctx ...interface{})

type LogLevel

type LogLevel int
const (
	LogLevelDebug LogLevel = 1 << iota
	LogLevelInfo
	LogLevelWarning
	LogLevelError
	LogLevelFatal
)

func (LogLevel) String

func (ll LogLevel) String() string

type Logger

type Logger interface {
	New(ctx ...interface{}) Logger
	Debug(msg string, ctx ...interface{})
	Info(msg string, ctx ...interface{})
	Warn(msg string, ctx ...interface{})
	Error(msg string, ctx ...interface{})
	Fatal(msg string, ctx ...interface{})
}

type RootLogger

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

func New

func New() *RootLogger

func NewWithContext

func NewWithContext(ctx []interface{}) *RootLogger

func (*RootLogger) AddHandler

func (l *RootLogger) AddHandler(handler *LogHandler)

func (*RootLogger) Debug

func (l *RootLogger) Debug(msg string, ctx ...interface{})

func (*RootLogger) Error

func (l *RootLogger) Error(msg string, ctx ...interface{})

func (*RootLogger) Fatal

func (l *RootLogger) Fatal(msg string, ctx ...interface{})

func (*RootLogger) Info

func (l *RootLogger) Info(msg string, ctx ...interface{})

func (*RootLogger) New

func (l *RootLogger) New(ctx ...interface{}) Logger

func (*RootLogger) Warn

func (l *RootLogger) Warn(msg string, ctx ...interface{})

Jump to

Keyboard shortcuts

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