stdlog

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int
const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarning
	LevelError
	LevelFatal
)

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	// Named returns a new logger with its previous name followed by a dot,
	// followed by the provided name.
	Named(name string) Logger
	SetLevel(level Level)

	Debug(msg string, keysAndValues ...any)
	Info(msg string, keysAndValues ...any)
	Warning(msg string, keysAndValues ...any)
	Error(err error, msg string, keysAndValues ...any)
	Fatal(msg string, keysAndValues ...any)
	FatalError(err error, msg string, keysAndValues ...any)
}

func NewNoop added in v0.0.2

func NewNoop() Logger

func NewSTD

func NewSTD(writer io.Writer) Logger

type StdLoggerOut

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

func (*StdLoggerOut) Debug

func (s *StdLoggerOut) Debug(msg string, kvs ...any)

func (*StdLoggerOut) Do

func (s *StdLoggerOut) Do(ts, caller, bt, msg string, level Level, err error, kvs ...any)

func (*StdLoggerOut) Error

func (s *StdLoggerOut) Error(err error, msg string, kvs ...any)

func (*StdLoggerOut) Fatal

func (s *StdLoggerOut) Fatal(msg string, kvs ...any)

func (*StdLoggerOut) FatalError

func (s *StdLoggerOut) FatalError(err error, msg string, kvs ...any)

func (*StdLoggerOut) Info

func (s *StdLoggerOut) Info(msg string, kvs ...any)

func (*StdLoggerOut) Named

func (s *StdLoggerOut) Named(name string) Logger

func (*StdLoggerOut) SetLevel

func (s *StdLoggerOut) SetLevel(level Level)

func (*StdLoggerOut) Warning

func (s *StdLoggerOut) Warning(msg string, kvs ...any)

Jump to

Keyboard shortcuts

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