logger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NilLogLogger = log.New(io.Discard, "", 0)
	NilLogger    nilLogger
)

Functions

func SetGlobal added in v0.2.0

func SetGlobal(l Logger)

SetGlobal sets a logger as global logger.

Types

type Logger added in v0.0.2

type Logger interface {
	fasthttp.Logger
	Rotater
	io.Closer
	LogLogger() *log.Logger
}

Logger is the interface that defines the methods to logging.

func Global added in v0.2.0

func Global() Logger

Global returns a logger that is set as global. If the global logger is not set then it returns NilLogger.

func NewLogger

func NewLogger(cfg config.Log) (Logger, error)

NewLogger returns a new logger.

func NewLoggerWriteRotateCloser added in v0.2.0

func NewLoggerWriteRotateCloser(cfg config.Log, out WriteRotateCloser) (Logger, error)

NewLoggerWriteRotateCloser returns a new logger with out.

func NewLoggerWriter added in v0.0.2

func NewLoggerWriter(cfg config.Log, out io.Writer) (Logger, error)

NewLoggerWriter returns a new logger with out.

type NopWriteRotateCloser added in v0.2.0

type NopWriteRotateCloser struct {
	io.Writer
}

NopWriteRotateCloser is a Writer with no-op Rotate and Close methods.

func (*NopWriteRotateCloser) Close added in v0.2.0

func (*NopWriteRotateCloser) Close() error

Close does nothing, returns nil.

func (*NopWriteRotateCloser) Rotate added in v0.2.0

func (*NopWriteRotateCloser) Rotate() error

Rotate does nothing, returns nil.

type Rotater added in v0.1.0

type Rotater interface {
	Rotate() error
}

Rotater is the interface that defines the methods to rotate files.

type WriteRotateCloser added in v0.2.0

type WriteRotateCloser interface {
	io.WriteCloser
	Rotater
}

WriteRotateCloser is the interface that groups the Rotate and basic Write, Close methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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