mlog

package
v3.9.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyGlobalConfig added in v3.6.0

func ApplyGlobalConfig(lc *LogConfig) error

func L

func L() *zap.Logger

L returns a logger that has a lvl Level(), and will write logs to InfoWriter() and ErrWriter(). The returned logger is shared by all L() call.

func Level

func Level() zap.AtomicLevel

func NewLogger added in v3.6.0

func NewLogger(lc *LogConfig) (*zap.Logger, error)

func NewPluginLogger

func NewPluginLogger(tag string) *zap.Logger

NewPluginLogger returns a named logger from L.

func S

func S() *zap.SugaredLogger

S returns a sugared L. The returned logger is shared by all S() call.

Types

type AtomicWriteSyncer

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

func ErrWriter added in v3.4.0

func ErrWriter() *AtomicWriteSyncer

func InfoWriter added in v3.4.0

func InfoWriter() *AtomicWriteSyncer

func NewAtomicWriteSyncer

func NewAtomicWriteSyncer(ws zapcore.WriteSyncer) *AtomicWriteSyncer

func (*AtomicWriteSyncer) Replace

func (a *AtomicWriteSyncer) Replace(ws zapcore.WriteSyncer)

func (*AtomicWriteSyncer) Sync

func (a *AtomicWriteSyncer) Sync() error

func (*AtomicWriteSyncer) Write

func (a *AtomicWriteSyncer) Write(p []byte) (n int, err error)

type LogConfig added in v3.6.0

type LogConfig struct {
	Level    string `yaml:"level"`
	File     string `yaml:"file"`
	ErrFile  string `yaml:"err_file"`
	InfoFile string `yaml:"info_file"`
}

Jump to

Keyboard shortcuts

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