log

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DebugLevel = func(level zapcore.Level) bool {
		return level == zap.DebugLevel
	}

	InfoLevel = func(level zapcore.Level) bool {
		return level == zap.InfoLevel
	}

	ErrorLevel = func(level zapcore.Level) bool {
		return level > zap.InfoLevel
	}
)

Functions

func GetWrite

func GetWrite(path string, maxSize, maxBackups, maxAge int, compress bool) io.Writer

Types

type Level

type Level func(level zapcore.Level) bool

type LoggerParam

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

LoggerParam 日志参数

func NewLogger

func NewLogger(path string, maxSize, maxBackups, maxAge int, compress bool) *LoggerParam

NewLogger 创建日志参数对象 @param path 日志文件路径 @param maxSize 日志最大存储量 @param maxBackups 日志最大备份数 @param maxAge 日志最大存储天数 @param compress 是否压缩 @return 日志参数对象

func (*LoggerParam) New

func (log *LoggerParam) New(logs map[string]Level) *zap.SugaredLogger

New 创建Uber日志对象 @param logs 日志文件 @return uber日志对象

Jump to

Keyboard shortcuts

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