myLogger

package
v0.0.0-...-f009a89 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelError = iota
	LevelWarn
	LevelInfo
	LevelDebug
)

RFC5424 log message levels.

View Source
const (
	GLOBAL = "global" //全局name空间
)
View Source
const TIMEFORMAT = "2006-01-02T15:04:05.999999999"

Variables

This section is empty.

Functions

func Debug

func Debug(msg ...interface{})

func Debugf

func Debugf(format string, msg ...interface{})

func Debugln

func Debugln(msg ...interface{})

func Error

func Error(msg ...interface{})

func Errorf

func Errorf(format string, msg ...interface{})

func Errorln

func Errorln(msg ...interface{})

func GetFields

func GetFields(entry *logrus.Entry, level logrus.Level) (logrus.Fields, bool, error)

func GetGID

func GetGID() uint64

func GetNameLog

func GetNameLog(name string) (l *logrus.Logger)

func HasLoggerInit

func HasLoggerInit() bool

func Info

func Info(msg ...interface{})

func Infof

func Infof(format string, msg ...interface{})

func Infoln

func Infoln(msg ...interface{})

func InitLoggers

func InitLoggers() error

func NewFileHook

func NewFileHook(config config.Configuration) (hook logrus.Hook, err error)

func NewMyLogFormatter

func NewMyLogFormatter(config config.Configuration) (formatter logrus.Formatter, err error)

func Warn

func Warn(msg ...interface{})

func Warnf

func Warnf(format string, msg ...interface{})

func Warnln

func Warnln(msg ...interface{})

Types

type FileHook

type FileHook struct {
	W *fileLogWriter
}

func (*FileHook) Fire

func (p *FileHook) Fire(entry *logrus.Entry) (err error)

func (*FileHook) Levels

func (p *FileHook) Levels() []logrus.Level

type MyFormatterConfig

type MyFormatterConfig struct {
	InHook  bool
	Address string `json:"address"`
}

func (*MyFormatterConfig) Format

func (f *MyFormatterConfig) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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