Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCallerHook ¶
func NewCallerHook() *callerHook
NewCallerHook Use to create the callerHook StandardLogger adds this Hook by default, which is used to increase the attributes of the specific location where the output log is located, so as to quickly locate the original file name and function name where the log output is located. StandardLogger默认添加了该Hook, 用于增加输出日志所在具体位置的属性, 便于快速定位日志输出所在的原文件名和函数名.
func NewFieldsHook ¶
NewFieldsHook Use to create the fieldsHook Used to add common log attributes 用于添加公共的日志属性
func NewLocalFSHook ¶
NewLocalFSHook returns new LFS hook. Output can be a string, io.Writer or WriterMap. If using io.Writer or WriterMap, user is responsible for closing the used io.Writer. 日志内容分级别输出到本地文件系统, 如: INFO级别输出到test.log文件, ERROR级别输出到test.err.log文件, DEBUG级别输出到os.Stderr
func NewMergeHook ¶
func NewMergeHook(ignoreKeys ...string) *mergeHook
NewMergeHook Used to merge all other attributes except the standard attributes into custom, to avoid too many attributes and inconvenient management, you can add default standard attributes by passing parameters. 用于合并除标准属性以外的其他所有属性到custom, 避免属性过多不便管理, 可通过传参增加默认的标准属性.
Types ¶
type LevelHooks ¶
type LevelHooks = logrus.LevelHooks