Documentation
¶
Index ¶
- func GetLogLevel(level string) []logrus.Level
- func GetLogLevelColorCode(level logrus.Level) string
- func Init()
- type LogFormat
- type LogHook
- func (hook *LogHook) ExecLogWrite(s string) error
- func (hook *LogHook) Fire(entry *logrus.Entry) error
- func (hook *LogHook) GetWriter() io.Writer
- func (hook *LogHook) Levels() []logrus.Level
- func (hook *LogHook) SetFormatter(consoleFormatter, fileFormatter logrus.Formatter)
- func (hook *LogHook) SetPath(path string)
- func (hook *LogHook) SetWriter(writer io.Writer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogLevel ¶
GetLogLevel 获取日志等级 "trace","debug","info","warn","warn","error"
func GetLogLevelColorCode ¶
GetLogLevelColorCode 获取日志等级对应色彩code
Types ¶
type LogHook ¶
type LogHook struct {
// contains filtered or unexported fields
}
LogHook logrus本地钩子
var Hook *LogHook
func NewLocalHook ¶
func NewLocalHook(args any, consoleFormatter, fileFormatter logrus.Formatter, levels ...logrus.Level) *LogHook
NewLocalHook 初始化本地日志钩子实现
func (*LogHook) ExecLogWrite ¶
func (*LogHook) SetFormatter ¶
SetFormatter set log format
Click to show internal directories.
Click to hide internal directories.