alog

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 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 DPanic

func DPanic(msg string, fields ...zap.Field)

DPanic passed at the log site, as well as any fields accumulated on the logger.<如果记录器处于开发模式,则会恐慌(DPanic表示 “发展恐慌”)。 这对于捕获错误很有用>

func Debug

func Debug(msg string, fields ...zap.Field)

Debug Debug printing<调试打印>

func Error

func Error(msg string, fields ...zap.Field)

Error printing<错误打印>

func Info

func Info(msg string, fields ...zap.Field)

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

func Panic

func Panic(msg string, fields ...zap.Field)

Panic Abnormal printing<异常打印>

func Warn

func Warn(msg string, fields ...zap.Field)

Warn Warning print<警告打印>

Types

type Logs

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 10M
	MaxAge      int    //7 days reserved, 180 days by default
	Compress    bool   //Whether to compress, no compression by default
	ServiceName string //Log service name, default antgo
	Format      string //Log format default console
	Console     bool   //Whether to output the console display
}

Logs parameter structure

func New

func New(path string) *Logs

New Default setting log

func (*Logs) Register

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

Register Set log

func (*Logs) SetCompress

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

SetCompress Do you need compression

func (*Logs) SetConsole

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

SetConsole Whether to output the console display<是否控制台打印>

func (*Logs) SetFormat

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

SetFormat Log format default console

func (*Logs) SetLevel

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

SetLevel setting log level

func (*Logs) SetMaxAge

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

SetMaxAge setting log

func (*Logs) SetMaxBackups

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

SetMaxBackups setting log

func (*Logs) SetMaxSize

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

SetMaxSize Set log maximum

func (*Logs) SetPath

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

SetPath setting log path

func (*Logs) SetServiceName

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