logger

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 8 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 Error

func Error(err error)

Error Error print log<捕获异常>

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 New

type New 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 10M
	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
}

New Log parameter structure

var Create New

Create 默认调用

func Default

func Default(path string) *New

Default setting log

func (*New) Register

func (get *New) Register() *zap.Logger

Register Set log

func (*New) SetMaxAge

func (get *New) SetMaxAge(MaxAge int) *New

SetMaxAge setting log

func (*New) SetMaxBackups

func (get *New) SetMaxBackups(MaxBackups int) *New

SetMaxBackups setting log

func (*New) SetMaxSize

func (get *New) SetMaxSize(MaxSize int) *New

SetMaxSize Set log maximum

func (*New) SetPath

func (get *New) SetPath(path string) *New

SetPath setting log path

func (*New) SetServiceName

func (get *New) SetServiceName(ServiceName string) *New

SetServiceName setting log

Jump to

Keyboard shortcuts

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