log

package
v0.0.0-...-fc17aaa Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReloadConfig

func ReloadConfig(opt *Options)

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 (*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"`
	ToFile     bool   `yaml:"toFile"` // 是否写到文件
}

Jump to

Keyboard shortcuts

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