logger

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerPretty

func CallerPretty(caller *runtime.Frame) (function string, file string)

将日志中记录的文件名 file 和方法名 func 转成短名字

func NewStdoutHook

func NewStdoutHook() *stdoutHook

Types

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

func (*Hook) Fire

func (h *Hook) Fire(entry *logrus.Entry) error

func (*Hook) Levels

func (h *Hook) Levels() []logrus.Level

func (*Hook) SetFields

func (h *Hook) SetFields(kv logrus.Fields)

type Logger

type Logger struct {
	*logrus.Logger
}

func Ins

func Ins(id ...string) *Logger

func (*Logger) Category

func (l *Logger) Category(c string) *logrus.Entry

func (*Logger) SetHookFields

func (l *Logger) SetHookFields(kv logrus.Fields)

Jump to

Keyboard shortcuts

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