log

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DiscardLogger = NewLogger(io.Discard, LogLevelError)

Functions

This section is empty.

Types

type LogLevel

type LogLevel int
const (
	LogLevelDebug LogLevel = iota
	LogLevelInfo
	LogLevelWarn
	LogLevelError
)

func (LogLevel) String

func (l LogLevel) String() string

func (*LogLevel) UnmarshalText

func (l *LogLevel) UnmarshalText(text []byte) error

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

func NewLogger

func NewLogger(w io.Writer, minLevel LogLevel) Logger

type LoggerFunc

type LoggerFunc func(level LogLevel, format string, args ...interface{})

func (LoggerFunc) Debugf

func (l LoggerFunc) Debugf(format string, args ...interface{})

func (LoggerFunc) Errorf

func (l LoggerFunc) Errorf(format string, args ...interface{})

func (LoggerFunc) Infof

func (l LoggerFunc) Infof(format string, args ...interface{})

func (LoggerFunc) Warnf

func (l LoggerFunc) Warnf(format string, args ...interface{})

Jump to

Keyboard shortcuts

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