Documentation
¶
Index ¶
- func AddBackend(be Backend)
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func SetBackend(be Backend)
- func SetFormattor(ft Formatter)
- func SetLevel(lvl string) error
- func Stop()
- func Sync()
- func Tracef(format string, args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnln(args ...interface{})
- type Backend
- type Fields
- type Formatter
- type InciseFileBackend
- type Level
- type TextFormatter
- type ZLog
- func (z *ZLog) AddBackend(be Backend)
- func (z *ZLog) Debugf(format string, args ...interface{})
- func (z *ZLog) Debugln(args ...interface{})
- func (z *ZLog) Errorf(format string, args ...interface{})
- func (z *ZLog) Errorln(args ...interface{})
- func (z *ZLog) Fatalf(format string, args ...interface{})
- func (z *ZLog) Fatalln(args ...interface{})
- func (z *ZLog) Infof(format string, args ...interface{})
- func (z *ZLog) Infoln(args ...interface{})
- func (z *ZLog) SetBackend(be Backend)
- func (z *ZLog) SetFormattor(ft Formatter)
- func (z *ZLog) SetLevel(level string) error
- func (z *ZLog) Stop()
- func (z *ZLog) Sync()
- func (z *ZLog) Tracef(format string, args ...interface{})
- func (z *ZLog) Warnf(format string, args ...interface{})
- func (z *ZLog) Warnln(args ...interface{})
- func (z *ZLog) WithFields(fields Fields) *ZLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs a message at level Debug on the standard logger.
func Debugln ¶
func Debugln(args ...interface{})
Debugln logs a message at level Debug on the standard logger.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs a message at level Error on the standard logger.
func Errorln ¶
func Errorln(args ...interface{})
Errorln logs a message at level Error on the standard logger.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf logs a message at level Fatal on the standard logger.
func Fatalln ¶
func Fatalln(args ...interface{})
Fatalln logs a message at level Fatal on the standard logger.
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs a message at level Info on the standard logger.
func Infoln ¶
func Infoln(args ...interface{})
Infoln logs a message at level Info on the standard logger.
func Tracef ¶
func Tracef(format string, args ...interface{})
Tracef logs a message at level Info on the standard logger.
Types ¶
type Formatter ¶
type Formatter interface {
SetLevel(lvl string) error
Format(level Level, msg string) []byte
WithFields(fields Fields)
}
Formatter 格式化前端
type InciseFileBackend ¶
type InciseFileBackend struct {
// contains filtered or unexported fields
}
InciseFileBackend 文件切割后端
func NewInciseFile ¶
func NewInciseFile(filePath, fileLink, prefix string, maxSize int64) (*InciseFileBackend, error)
NewInciseFile create file backend
type Level ¶
type Level uint8
Level 日志等级
func ParseLevel ¶
ParseLevel takes a string level and returns the Logrus log level constant.
type TextFormatter ¶
type TextFormatter struct {
// contains filtered or unexported fields
}
TextFormatter 文本格式化前端
func (*TextFormatter) Format ¶
func (f *TextFormatter) Format(level Level, msg string) []byte
Format 日志格式 2006-01-02 15:04:05 [error] test.go 245 : this is a error
func (*TextFormatter) WithFields ¶
func (f *TextFormatter) WithFields(fields Fields)
WithFields 添加一个map
type ZLog ¶
type ZLog struct {
// contains filtered or unexported fields
}
ZLog is a log
func (*ZLog) Debugln ¶
func (z *ZLog) Debugln(args ...interface{})
Debugln logs a message at level Debug on the standard logger.
func (*ZLog) Errorln ¶
func (z *ZLog) Errorln(args ...interface{})
Errorln logs a message at level Error on the standard logger.
func (*ZLog) Fatalln ¶
func (z *ZLog) Fatalln(args ...interface{})
Fatalln logs a message at level Fatal on the standard logger.
func (*ZLog) Infoln ¶
func (z *ZLog) Infoln(args ...interface{})
Infoln logs a message at level Info on the standard logger.