logx

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Debug added in v0.0.3

func Debug(msg string)

Debug ...

func Debugf

func Debugf(msg string, args ...interface{})

Debugf ...

func Error added in v0.0.3

func Error(msg string)

func Errorf

func Errorf(msg string, args ...interface{})

Errorf ...

func Info added in v0.0.3

func Info(msg string)

func Infof

func Infof(msg string, args ...interface{})

Infof ...

func Panic added in v0.0.3

func Panic(msg string)

func Panicf

func Panicf(msg string, args ...interface{})

Panicf ...

func SetLogger

func SetLogger(config *Config) *zap.SugaredLogger

func Warn added in v0.0.3

func Warn(msg string)

func Warnf

func Warnf(msg string, args ...interface{})

Warnf ...

Types

type Config

type Config struct {
	Mode       string // 开发模式,当Mode=dev时,日志的level=Debug,其它是Info
	FileName   string // 日志文件的位置
	MaxSize    int    // 在进行日志切割之前,日志文件的最大大小(以MB为单位)
	MaxAge     int    // 保留旧文件的最大天数
	MaxBackups int    // 保留旧文件的最大个数
	Compress   bool   // 是否压缩
}

func NewDefaultConfig

func NewDefaultConfig() *Config

Jump to

Keyboard shortcuts

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