Documentation ¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func NewContext(ctx context.Context, lo StdLogger, fields Fields) context.Context
- func Printf(format string, args ...interface{})
- func Println(format string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func WithError(err error) *logrus.Entry
- func WithFields(f Fields) *logrus.Entry
- func WithLogger() *logrus.Logger
- type Fields
- type Key
- type Level
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorln(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Printf(format string, args ...interface{})
- func (l *Logger) Println(format string, args ...interface{})
- func (l *Logger) SetLevel(v Level)
- func (l *Logger) SetPrefix(value interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) WithError(err error) *logrus.Entry
- func (l *Logger) WithFields(f Fields) *logrus.Entry
- func (l *Logger) WithLogger() *logrus.Logger
- type StdLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext creates a new log entry and adds it to the given context
func WithFields ¶
func WithLogger ¶
Types ¶
type Level ¶
type Level int32
Level represents a log level.
const ( // FatalLevel is used for undesired and unexpected events that // the program cannot recover from. FatalLevel Level = iota // ErrorLevel is used for undesired and unexpected events that // the program can recover from. ErrorLevel // WarnLevel is used for undesired but relatively expected events, // which may indicate a problem. WarnLevel // InfoLevel is used for general informational log messages. InfoLevel // DebugLevel is the lowest level of logging. // Debug logs are intended for debugging and development purposes. DebugLevel )
func ParseLevel ¶
ParseLevel takes a string level and returns the Logrus log level constant.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger logs message to io.Writer at various log levels.
func NewLogger ¶
NewLogger creates and returns a new instance of Logger. Log level is set to DebugLevel by default.
func (*Logger) SetLevel ¶
SetLevel sets the logger level. It panics if v is less than DebugLevel or greater than FatalLevel.
func (*Logger) SetPrefix ¶
func (l *Logger) SetPrefix(value interface{})
WithField sets logger fields
func (*Logger) WithLogger ¶
type StdLogger ¶
type StdLogger interface { Info(args ...interface{}) Debug(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) WithFields(f Fields) *logrus.Entry WithError(err error) *logrus.Entry }
func FromContext ¶
FromContext extracts the log entry from the given context
Click to show internal directories.
Click to hide internal directories.