log

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int8
const (
	LevelNone Level = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
)

func ParseLevel

func ParseLevel(text string) (Level, error)

func (Level) MarshalText

func (l Level) MarshalText() ([]byte, error)

func (Level) String

func (l Level) String() string

String returns a lower-case ASCII representation of the log level.

func (*Level) UnmarshalText

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

type Logger

type Logger interface {
	Debug(string)
	Info(string)
	Warn(string)
	Error(string)
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Errorf(template string, args ...interface{})
}

type NilLogger

type NilLogger struct{}

func NewNilLogger

func NewNilLogger() *NilLogger

func (*NilLogger) Debug

func (*NilLogger) Debug(string)

func (*NilLogger) Debugf

func (*NilLogger) Debugf(string, ...interface{})

func (*NilLogger) Error

func (*NilLogger) Error(string)

func (*NilLogger) Errorf

func (*NilLogger) Errorf(string, ...interface{})

func (*NilLogger) Info

func (*NilLogger) Info(string)

func (*NilLogger) Infof

func (*NilLogger) Infof(string, ...interface{})

func (*NilLogger) Warn

func (*NilLogger) Warn(string)

func (*NilLogger) Warnf

func (*NilLogger) Warnf(string, ...interface{})

type StdLogger

type StdLogger struct {
	*log.Logger
	// contains filtered or unexported fields
}

func NewStdLogger

func NewStdLogger(logLevel Level) *StdLogger

func (*StdLogger) Debug

func (l *StdLogger) Debug(msg string)

func (*StdLogger) Debugf

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

func (*StdLogger) Error

func (l *StdLogger) Error(msg string)

func (*StdLogger) Errorf

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

func (*StdLogger) Info

func (l *StdLogger) Info(msg string)

func (*StdLogger) Infof

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

func (*StdLogger) LogWithLevel

func (l *StdLogger) LogWithLevel(level Level, msg string)

func (*StdLogger) LogWithLevelf added in v2.5.0

func (l *StdLogger) LogWithLevelf(level Level, format string, args ...interface{})

LogWithLevelf uses fmt.Errorf to construct and log.Printf to log a message.

func (*StdLogger) Warn

func (l *StdLogger) Warn(msg string)

func (*StdLogger) Warnf

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

Jump to

Keyboard shortcuts

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