zlog

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 6 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
}

func NewLogger

func NewLogger(opfs ...func(opt *Option)) *Logger

func NewLoggerWithConfig

func NewLoggerWithConfig(opt *Option) *Logger

func (*Logger) Arg added in v0.4.9

func (l *Logger) Arg(value interface{}) *Logger

func (*Logger) Err added in v0.4.9

func (l *Logger) Err(err error) *Logger

func (*Logger) Namespace

func (l *Logger) Namespace(key string) *Logger

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

func (*Logger) With

func (l *Logger) With(key string, value interface{}) *Logger

type Option

type Option struct {
	Path        string // 文件绝对地址,如:/home/homework/neso/file.log
	Level       string // 日志输出的级别
	MaxFileSize int    // 日志文件大小的最大值,单位(M)
	MaxBackups  int    // 最多保留备份数
	MaxAge      int    // 日志文件保存的时间,单位(天)
	Compress    bool   // 是否压缩
	Caller      bool   // 日志是否需要显示调用位置
	StdOut      bool   // 是否输出到控制台
	FileOut     bool   // 是否需要文件输出
	Source      string // 标志
}

Jump to

Keyboard shortcuts

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