logger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...LogField)

Debug 日志

func Error

func Error(err error, fields ...LogField)

Error 日志

func Errorf

func Errorf(msg string, err interface{}, fields ...LogField)

Errorf 日志

func Fatal

func Fatal(msg string, fields ...LogField)

Fatal 日志

func Info

func Info(msg string, fields ...LogField)

Info 日志

func InitLog

func InitLog(c LogConfig)

InitLog 注册日志

func Panic

func Panic(msg error, fields ...LogField)

Panic 日志

func Warn

func Warn(msg string, fields ...LogField)

Warn 日志

Types

type LogConfig

type LogConfig struct {
	Type  string `value:"type"`
	Path  string `value:"path"`
	Level string `value:"level"`
	Stack bool   `value:"stack"`
}

LogConfig 日志配置文件

type LogFactory

type LogFactory struct {
	Cfg LogConfig `value:"logger"`
}

func NewLogFactory

func NewLogFactory() *LogFactory

func (*LogFactory) InitLog

func (l *LogFactory) InitLog()

type LogField

type LogField map[string]interface{}

LogField 隔离引用

func (LogField) Put

func (l LogField) Put(key string, value interface{}) LogField

Put 属性赋值

Jump to

Keyboard shortcuts

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