Documentation
¶
Overview ¶
Package log defines the logger interfaces used by pulsar client. Users can leverage these interfaces to provide a customized logger implementation.
The Logger and Entry interfaces defined here are inspired by sirupsen/logrus, both logrus and zap logging libraries are good resources to learn how to implement a effective logging library.
Besides the interfaces, this log library also provides an implementation based on logrus, and a No-op one as well.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry interface {
WithFields(fields Fields) Entry
WithField(name string, value interface{}) Entry
Debug(args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
}
Entry describes the interface for the logger entry.
type Logger ¶
type Logger interface {
SubLogger(fields Fields) Logger
WithFields(fields Fields) Entry
WithField(name string, value interface{}) Entry
WithError(err error) Entry
Debug(args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
}
Logger describes the interface that must be implemeted by all loggers.
func NewLoggerWithLogrus ¶
NewLoggerWithLogrus creates a new logger which wraps the given logrus.Logger