logger

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugInfo

func DebugInfo(skip int, fidles logrus.Fields) (debugInfo logrus.Fields)

DebugInfo combain user fidles with debug information

func Has

func Has(name string) bool

Has returns true if the logger created before.

func LevelLog

func LevelLog(entry *logrus.Entry, level logrus.Level, msg string)

LevelLog provides an interface for logging with specific format

func List

func List() []string

List shows created loggers.

Types

type Entry

type Entry struct {
	*logrus.Entry
	// contains filtered or unexported fields
}

Entry add some function on logrus.Entry

func WithError

func WithError(err error) *Entry

func WithField

func WithField(key string, value interface{}) *Entry

func WithFields

func WithFields(fields logrus.Fields) *Entry

func WithTime

func WithTime(t time.Time) *Entry

func (*Entry) Debug

func (entry *Entry) Debug(args ...interface{})

func (*Entry) Debugf

func (entry *Entry) Debugf(format string, args ...interface{})

func (*Entry) Debugln

func (entry *Entry) Debugln(args ...interface{})

func (*Entry) Error

func (entry *Entry) Error(args ...interface{})

func (*Entry) Errorf

func (entry *Entry) Errorf(format string, args ...interface{})

func (*Entry) Errorln

func (entry *Entry) Errorln(args ...interface{})

func (*Entry) Fatal

func (entry *Entry) Fatal(args ...interface{})

func (*Entry) Fatalf

func (entry *Entry) Fatalf(format string, args ...interface{})

func (*Entry) Fatalln

func (entry *Entry) Fatalln(args ...interface{})

func (*Entry) Info

func (entry *Entry) Info(args ...interface{})

func (*Entry) Infof

func (entry *Entry) Infof(format string, args ...interface{})

func (*Entry) Infoln

func (entry *Entry) Infoln(args ...interface{})

func (*Entry) Panic

func (entry *Entry) Panic(args ...interface{})

func (*Entry) Panicf

func (entry *Entry) Panicf(format string, args ...interface{})

func (*Entry) Panicln

func (entry *Entry) Panicln(args ...interface{})

func (*Entry) Print

func (entry *Entry) Print(args ...interface{})

func (*Entry) Printf

func (entry *Entry) Printf(format string, args ...interface{})

func (*Entry) Println

func (entry *Entry) Println(args ...interface{})

func (*Entry) Trace

func (entry *Entry) Trace(args ...interface{})

func (*Entry) Tracef

func (entry *Entry) Tracef(format string, args ...interface{})

func (*Entry) Traceln

func (entry *Entry) Traceln(args ...interface{})

func (*Entry) Warn

func (entry *Entry) Warn(args ...interface{})

func (*Entry) Warnf

func (entry *Entry) Warnf(format string, args ...interface{})

func (*Entry) Warning

func (entry *Entry) Warning(args ...interface{})

func (*Entry) Warningf

func (entry *Entry) Warningf(format string, args ...interface{})

func (*Entry) Warningln

func (entry *Entry) Warningln(args ...interface{})

func (*Entry) Warnln

func (entry *Entry) Warnln(args ...interface{})

func (*Entry) WithError

func (entry *Entry) WithError(err error) *Entry

func (*Entry) WithField

func (entry *Entry) WithField(key string, value interface{}) *Entry

func (*Entry) WithFields

func (entry *Entry) WithFields(fields logrus.Fields) *Entry

func (*Entry) WithTime

func (entry *Entry) WithTime(t time.Time) *Entry

type Logger

type Logger struct {
	*logrus.Logger

	Path string
	// contains filtered or unexported fields
}

Logger add some attributes, base on logrus.Logger.

func Get

func Get(name string) *Logger

Get find the logger from storage.

func New

func New(name string, base logrus.Level, level []logrus.Level, dev bool) (*Logger, error)

New create a new logger.

func (*Logger) Config added in v0.2.0

func (logger *Logger) Config(base logrus.Level, level []logrus.Level, dev bool) error

Config updates the config of the logger.

func (*Logger) Debug

func (logger *Logger) Debug(args ...interface{})

func (*Logger) Debugf

func (logger *Logger) Debugf(format string, args ...interface{})

func (*Logger) Debugln

func (logger *Logger) Debugln(args ...interface{})

func (*Logger) Error

func (logger *Logger) Error(args ...interface{})

func (*Logger) Errorf

func (logger *Logger) Errorf(format string, args ...interface{})

func (*Logger) Errorln

func (logger *Logger) Errorln(args ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(args ...interface{})

func (*Logger) Fatalf

func (logger *Logger) Fatalf(format string, args ...interface{})

func (*Logger) Fatalln

func (logger *Logger) Fatalln(args ...interface{})

func (*Logger) Info

func (logger *Logger) Info(args ...interface{})

func (*Logger) Infof

func (logger *Logger) Infof(format string, args ...interface{})

func (*Logger) Infoln

func (logger *Logger) Infoln(args ...interface{})

func (*Logger) Panic

func (logger *Logger) Panic(args ...interface{})

func (*Logger) Panicf

func (logger *Logger) Panicf(format string, args ...interface{})

func (*Logger) Panicln

func (logger *Logger) Panicln(args ...interface{})

func (*Logger) Print

func (logger *Logger) Print(args ...interface{})

func (*Logger) Printf

func (logger *Logger) Printf(format string, args ...interface{})

func (*Logger) Println

func (logger *Logger) Println(args ...interface{})

func (*Logger) Trace

func (logger *Logger) Trace(args ...interface{})

func (*Logger) Tracef

func (logger *Logger) Tracef(format string, args ...interface{})

func (*Logger) Traceln

func (logger *Logger) Traceln(args ...interface{})

func (*Logger) Wait

func (logger *Logger) Wait()

Wait wait for all logging complete

func (*Logger) Warn

func (logger *Logger) Warn(args ...interface{})

func (*Logger) Warnf

func (logger *Logger) Warnf(format string, args ...interface{})

func (*Logger) Warning

func (logger *Logger) Warning(args ...interface{})

func (*Logger) Warningf

func (logger *Logger) Warningf(format string, args ...interface{})

func (*Logger) Warningln

func (logger *Logger) Warningln(args ...interface{})

func (*Logger) Warnln

func (logger *Logger) Warnln(args ...interface{})

func (*Logger) WithError

func (logger *Logger) WithError(err error) *Entry

func (*Logger) WithField

func (logger *Logger) WithField(key string, value interface{}) *Entry

func (*Logger) WithFields

func (logger *Logger) WithFields(fields logrus.Fields) *Entry

func (*Logger) WithTime

func (logger *Logger) WithTime(t time.Time) *Entry

Jump to

Keyboard shortcuts

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