mlog

package
v5.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func L

func L() *zap.Logger

L is a global logger.

func NewLogger

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

func Nop

func Nop() *zap.Logger

Nop is a logger that never writes out logs.

func S

func S() *zap.SugaredLogger

S is a global logger.

func SetLevel

func SetLevel(l zapcore.Level)

SetLevel sets the log level for the global logger.

Types

type LogConfig

type LogConfig struct {
	// Level, See also zapcore.ParseLevel.
	Level string `yaml:"level"`

	// File that logger will be writen into.
	// Default is stderr.
	File string `yaml:"file"`

	// Production enables json output.
	Production bool `yaml:"production"`
}

Jump to

Keyboard shortcuts

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