logger

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func RotateShared added in v0.3.2

func RotateShared() error

RotateShared calls Rotate each shared rotaters.

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 NewLogger

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

NewLogger creates a new logger.

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 NopRotater added in v0.3.2

type NopRotater struct {
	io.Writer
}

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

func (*NopRotater) Close added in v0.3.2

func (*NopRotater) Close() error

Close does nothing, returns nil.

func (*NopRotater) Rotate added in v0.3.2

func (*NopRotater) Rotate() error

Rotate does nothing, returns nil.

type Rotater added in v0.1.0

type Rotater interface {
	io.WriteCloser
	Rotate() error
}

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

func NewRotater added in v0.3.2

func NewRotater(output string, cfg config.Rotation) (Rotater, error)

NewRotater creates a new rotater.

func SharedRotater added in v0.3.2

func SharedRotater(output string, cfg config.Rotation) (Rotater, error)

SharedRotater returns a Rotater that is mapped by output. If the Rotater mapped by output does not exist, a new Rotater is created. If there are duplicate ouput, the backward cfg is ignored.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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