stdlog

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger added in v1.0.3

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

Logger implements the forwarder.Logger interface using the standard log package.

func Debug added in v1.2.0

func Debug() *Logger

func Default

func Default() *Logger

func New

func New(cfg *flog.Config, opts ...Option) *Logger

func (*Logger) Debugf added in v1.0.3

func (sl *Logger) Debugf(format string, args ...any)

func (*Logger) Errorf added in v1.0.3

func (sl *Logger) Errorf(format string, args ...any)

func (*Logger) Infof added in v1.0.3

func (sl *Logger) Infof(format string, args ...any)

func (Logger) Named added in v1.0.3

func (sl Logger) Named(name string) *Logger

func (*Logger) Unwrap added in v1.0.3

func (sl *Logger) Unwrap() *log.Logger

Unwrap returns the underlying log.Logger pointer.

type Option added in v1.1.0

type Option func(*Logger)

Option is a function that modifies the Logger.

func WithDecorate added in v1.1.0

func WithDecorate(f func(string) string) Option

WithDecorate allows to a function that modifies the log message before it is written.

func WithLabels added in v1.1.1

func WithLabels(labels ...string) Option

WithLabels allows to set labels that are added to each log message.

func WithOnError added in v1.1.0

func WithOnError(f func(name string)) Option

WithOnError allows to set a function that is called when an error is logged.

Jump to

Keyboard shortcuts

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