Documentation ¶
Index ¶
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func SetGlobal(i Interface)
- func Setup(logLevel string) error
- func Warnf(format string, args ...interface{})
- func Warnln(args ...interface{})
- type Fields
- type Format
- type Interface
- func Global() Interface
- func GoKit(logger log.Logger) Interface
- func Logrus(l *logrus.Logger) Interface
- func NewGoKit(l Level) Interface
- func NewGoKitFormat(l Level, f Format) Interface
- func NewLogrus(level Level) Interface
- func NewLogrusFormat(level Level, f Format) Interface
- func Noop() Interface
- func WithField(key string, value interface{}) Interface
- type Level
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf convenience function calls the global loggerr.
func Debugln ¶
func Debugln(args ...interface{})
Debugln convenience function calls the global logger.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf convenience function calls the global logger.
func Errorln ¶
func Errorln(args ...interface{})
Errorln convenience function calls the global logger.
func Infof ¶
func Infof(format string, args ...interface{})
Infof convenience function calls the global logger.
func Setup ¶
Setup configures a global logrus logger to output to stderr. It populates the standard logrus logger as well as the global logging instance.
Types ¶
type Fields ¶
type Fields map[string]interface{}
Fields convenience type for adding multiple fields to a log statement.
type Format ¶
Format is a settable identifier for the output format of logs
func (Format) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler.
func (*Format) RegisterFlags ¶
RegisterFlags adds the log format flag to the provided flagset.
func (*Format) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.
type Interface ¶
type Interface interface { Debugf(format string, args ...interface{}) Debugln(args ...interface{}) Infof(format string, args ...interface{}) Infoln(args ...interface{}) Errorf(format string, args ...interface{}) Errorln(args ...interface{}) Warnf(format string, args ...interface{}) Warnln(args ...interface{}) WithField(key string, value interface{}) Interface WithFields(Fields) Interface }
Interface 'unifies' gokit logging and logrus logging, such that the middleware in this repo can be used in projects which use either loggers.
func NewGoKitFormat ¶
NewGoKitFormat creates a new Interface backed by a GoKit logger format can be "json" or defaults to logfmt
func NewLogrusFormat ¶
NewLogrusFormat makes a new Interface backed by a logrus logger format can be "json" or defaults to logfmt
type Level ¶
type Level struct { Logrus logrus.Level Gokit level.Option // contains filtered or unexported fields }
Level is a settable identifier for the minimum level a log entry must be have.
func (Level) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler.
func (*Level) RegisterFlags ¶
RegisterFlags adds the log level flag to the provided flagset.
func (*Level) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler.