log

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zap.Logger
	sync.RWMutex
	Opts *Options
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger() (ret *Logger)

GetLogger returns logger

func NewLogger

func NewLogger(cf *Options) (*Logger, error)

func (*Logger) GetLevel

func (l *Logger) GetLevel() (level zapcore.Level)

type Options

type Options struct {
	LogFileDir string `yaml:"logFileDir"`
	AppName    string `yaml:"appName"`
	Platform   string `yaml:"platform"`
	MaxSize    int    `yaml:"maxSize"`    //文件多大开始切分
	MaxBackups int    `yaml:"maxBackups"` //保留文件个数
	MaxAge     int    `yaml:"maxAge"`     //文件保留最大实际
	Level      string `yaml:"level"`
}

Jump to

Keyboard shortcuts

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