zaplog

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	DebugLevel int8 = iota - 1
	// InfoLevel is the default logging priority.
	InfoLevel
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel
	// DPanicLevel logs are particularly important errors. In development the
	// logger panics after writing the message.
	DPanicLevel
	// PanicLevel logs a message, then panics.
	PanicLevel
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel
)

Variables

This section is empty.

Functions

func DPanic

func DPanic(args ...interface{})

DPanic ()

func DPanicf

func DPanicf(template string, args ...interface{})

DPanicf ()

func Debug

func Debug(args ...interface{})

Debug ()

func Debugf

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

Debugf ()

func Error

func Error(args ...interface{})

Error ()

func Errorf

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

Errorf ()

func Fatal

func Fatal(args ...interface{})

Fatal ()

func Fatalf

func Fatalf(template string, args ...interface{})

Fatalf ()

func Flush

func Flush()

Flush ()

func Info

func Info(args ...interface{})

Info ()

func Infof

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

Infof ()

func NewSugar added in v1.0.19

func NewSugar(strFilename string, nMaxSizeMB int, bLocalTime bool, bCompress bool, nMaxAge int, strTimeFormat string, nLevel int8)

NewSugar 新建一个糖 usage : NewSugar(autologfilename(), 50, true, true, 60, "2006-01-02 15:04:05.000", DebugLevel) @strFilename 保存的文件名 @nMaxSizeMB 截取的文件大小, 每隔多少MB截取 @bLocalTime 是否使用本地时间 @bCompress 是否压缩 @nMaxAge 文件最多保存多少天 @strTimeFormat 时间格式 @nLevel 日志的保存等级

func Panic

func Panic(args ...interface{})

Panic ()

func Panicf

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

Panicf ()

func Print

func Print(args ...interface{})

Print 为了兼容

func Printf

func Printf(template string, args ...interface{})

Printf 为了兼容

func Println

func Println(args ...interface{})

Println 为了兼容

func Since added in v1.0.18

func Since(t time.Time) time.Duration

Since 给 defer 用的函数 defer zaplog.Since(time.Now())

func Warn

func Warn(args ...interface{})

Warn ()

func Warnf

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

Warnf ()

Types

This section is empty.

Jump to

Keyboard shortcuts

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