log

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormatText format log text
	FormatText = "text"
	// FormatJSON format log json
	FormatJSON = "json"
)

Variables

This section is empty.

Functions

func Debug

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

Debug output log

func Error

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

Error output log

func Fatal

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

Fatal output log

func Info

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

Info output log

func InitLog

func InitLog(opts ...Option) error

InitLog conf

func Panic

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

Panic output panic

func Warn

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

Warn output log

Types

type Option

type Option func(*logConfig)

Option function option

func Compress

func Compress(compress bool) Option

Compress compress log

func Format

func Format(format string) Option

Format log json or text

func Level

func Level(level string) Option

Level set log level default info

func MaxAge

func MaxAge(age int) Option

MaxAge log store day

func MaxBackups

func MaxBackups(backup int) Option

MaxBackups total store log

func MaxSize

func MaxSize(size int) Option

MaxSize Log Max Size

func Path

func Path(logpath string) Option

Path set logpath if is zero will print,or write file

Jump to

Keyboard shortcuts

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