util

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NullLogger = nullLogger{}

NullLogger is a logger ignoring any input.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
	Println(v ...interface{})
	Err(error)
}

Logger can be used to report logging messages. The native log.Logger type implements this interface.

type ProxyLogger

type ProxyLogger struct {
	Logger Logger
}

ProxyLogger is a logger delegating to an underlying logger. Can be used to change the active logger during runtime.

func NewProxyLogger

func NewProxyLogger(logger Logger) *ProxyLogger

func (*ProxyLogger) Err

func (l *ProxyLogger) Err(err error)

func (*ProxyLogger) Printf

func (l *ProxyLogger) Printf(format string, v ...interface{})

func (*ProxyLogger) Println

func (l *ProxyLogger) Println(v ...interface{})

type StdLogger

type StdLogger struct {
	*log.Logger
}

StdLogger is a logger using the standard logger.

func NewStdLogger

func NewStdLogger(prefix string, flags int) StdLogger

func (StdLogger) Err

func (l StdLogger) Err(err error)

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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