log

package
v1.2.82 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLog

func GetLog(path string, showCodeLine bool) *log.Logger

Types

type MyHook

type MyHook struct {
	Path         string //存储日志的位置
	ShowCodeLine bool   //输出代码文件名称和日志行
	Field        string
	Skip         int
	// contains filtered or unexported fields
}

MyHook ...

func (*MyHook) Fire

func (that *MyHook) Fire(entry *log.Entry) error

Fire 将异常日志写入到指定日志文件中

func (*MyHook) Levels

func (that *MyHook) Levels() []log.Level

Levels 只定义 error 和 panic 等级的日志,其他日志等级不会触发 hook

Jump to

Keyboard shortcuts

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