Documentation ¶
Index ¶
- func Debugf(format string, args ...interface{})
- func EarlierInitLogger()
- func Errorf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func Printf(format string, args ...interface{})
- func Tracef(format string, args ...interface{})
- func Warnf(format string, args ...interface{})
- func WithContext(ctx context.Context) *logrus.Entry
- func WithError(err error) *logrus.Entry
- func WithField(key string, value interface{}) *logrus.Entry
- func WithFields(fields logrus.Fields) *logrus.Entry
- type Base
- func (s *Base) Debug(fmt string, args ...interface{})
- func (s *Base) Info(fmt string, args ...interface{})
- func (s *Base) Print(args ...interface{})
- func (s *Base) Printf(fmt string, args ...interface{})
- func (s *Base) Skip(level int) *Base
- func (s *Base) Trace(fmt string, args ...interface{})
- func (s *Base) Warn(fmt string, args ...interface{})
- func (s *Base) With(key string, value interface{}) *Base
- func (s *Base) With2(key string, value interface{}, key2 string, value2 interface{}) *Base
- func (s *Base) With3(key string, value interface{}, key2 string, value2 interface{}, key3 string, ...) *Base
- func (s *Base) Wrong(e error, fmt string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EarlierInitLogger ¶
func EarlierInitLogger()
func WithContext ¶
WithContext creates an entry from the standard logger and adds a context to it.
func WithError ¶
WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.
func WithField ¶
WithField creates an entry from the standard logger and adds a field to it. If you want multiple fields, use `WithFields`.
Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.
func WithFields ¶
WithFields creates an entry from the standard logger and adds multiple fields to it. This is simply a helper for `WithField`, invoking it once for each field.
Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.
Types ¶
type Base ¶
func (*Base) With ¶
With can add key-value pair to logger context and print them later.
~~With could cause race exception, for example: when two or more clients incoming with CONNECT packets, now connectParser parse them ok and print logging info via base.With("sth", sb).Debug(...), here is the race point.~~
NOTE: data race had solved.
Another scene is the multiple clients send pingreq packets.