Documentation ¶
Index ¶
- func GetLogrusEntry(l Logger) (*logrus.Entry, error)
- func SetDefault(logger Logger)
- func WithLogger(ctx context.Context, logger Logger) context.Context
- type Fields
- type Logger
- type LogrusConfig
- type LogrusFormatter
- type NopLogger
- func (NopLogger) AddPFlags(*cobra.Command)
- func (NopLogger) Debug(...interface{})
- func (NopLogger) Debugf(string, ...interface{})
- func (NopLogger) Error(...interface{})
- func (NopLogger) Errorf(string, ...interface{})
- func (NopLogger) Fatal(...interface{})
- func (NopLogger) Fatalf(string, ...interface{})
- func (NopLogger) Info(...interface{})
- func (NopLogger) Infof(string, ...interface{})
- func (NopLogger) Printf(string, ...interface{})
- func (NopLogger) Warn(...interface{})
- func (NopLogger) Warnf(string, ...interface{})
- func (l NopLogger) WithError(error) Logger
- func (l NopLogger) WithField(string, interface{}) Logger
- func (l NopLogger) WithFields(Fields) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶
func SetDefault(logger Logger)
Types ¶
type Logger ¶
type Logger interface { Printf(string, ...interface{}) Debug(...interface{}) Info(...interface{}) Warn(...interface{}) Fatal(...interface{}) Error(...interface{}) Debugf(string, ...interface{}) Infof(string, ...interface{}) Warnf(string, ...interface{}) Fatalf(string, ...interface{}) Errorf(string, ...interface{}) WithField(string, interface{}) Logger WithFields(Fields) Logger WithError(error) Logger // AddPFlags adds persistent logger flags to cmd AddPFlags(*cobra.Command) }
func FromLogrus ¶
func FromLogrus(l *logrus.Entry, c *LogrusConfig) Logger
type LogrusConfig ¶
type LogrusConfig struct { Level string Format LogrusFormatter }
type LogrusFormatter ¶
type LogrusFormatter string
const ( FormatterText LogrusFormatter = defaultFormatter FormatterJSON LogrusFormatter = "json" )
Click to show internal directories.
Click to hide internal directories.