logger

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Write *zap.Logger

Write Inherit zap log

Functions

func AsyncInfo

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

AsyncInfo Asynchronous print log<异步打印日志>

func Debug

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

Debug Debug printing<调试打印>

func Errors

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

Errors Error printing<错误打印>

func FormateLog

func FormateLog(args []interface{}) *zap.Logger

FormateLog ...

func Info

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

Info Print log by default<默认情况下打印日志>

func Panic

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

Panic Abnormal printing<异常打印>

func ToJsonData

func ToJsonData(args []interface{}) zap.Field

ToJsonData ...

func Warn

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

Warn Warning print<警告打印>

Types

type Logs added in v1.3.0

type Logs struct {
	Path        string //Save Path
	Level       string //Set log level,info debug warn
	MaxBackups  int    //Keep 30 backups, 300 by default
	MaxSize     int    //Each log file saves 10M, the default is 1M
	MaxAge      int    //7 days reserved, 30 days by default
	Compress    bool   //Whether to compress, no compression by default
	ServiceName string //Log service name, default Ginp
	Format      string //Log format default console
	Console     bool   //Whether to output the console display
}

Log parameter structure

func Default

func Default(path string) *Logs

Default setting log

func (*Logs) Register added in v1.3.0

func (logs *Logs) Register() *zap.Logger

Register Set log

func (*Logs) SetCompress added in v1.3.0

func (logs *Logs) SetCompress(compress bool) *Logs

SetCompress Do you need compression

func (*Logs) SetConsole added in v1.3.0

func (logs *Logs) SetConsole(console bool) *Logs

SetConsole Whether to output the console display

func (*Logs) SetFormat added in v1.3.0

func (logs *Logs) SetFormat(format string) *Logs

SetFormat Log format default console

func (*Logs) SetLevel added in v1.3.0

func (logs *Logs) SetLevel(level string) *Logs

SetLevel setting log level

func (*Logs) SetMaxAge added in v1.3.0

func (logs *Logs) SetMaxAge(MaxAge int) *Logs

SetMaxAge setting log

func (*Logs) SetMaxBackups added in v1.3.0

func (logs *Logs) SetMaxBackups(MaxBackups int) *Logs

SetMaxBackups setting log

func (*Logs) SetMaxSize added in v1.3.0

func (logs *Logs) SetMaxSize(MaxSize int) *Logs

SetMaxSize Set log maximum

func (*Logs) SetPath added in v1.3.0

func (logs *Logs) SetPath(path string) *Logs

SetPath setting log path

func (*Logs) SetServiceName added in v1.3.0

func (logs *Logs) SetServiceName(ServiceName string) *Logs

SetServiceName setting log

Jump to

Keyboard shortcuts

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