Documentation ¶
Index ¶
- Variables
- func Debug(ctx context.Context, args ...interface{})
- func Debugf(ctx context.Context, format string, args ...interface{})
- func Debugln(ctx context.Context, args ...interface{})
- func Error(ctx context.Context, args ...interface{})
- func Errorf(ctx context.Context, format string, args ...interface{})
- func Errorln(ctx context.Context, args ...interface{})
- func Fatal(ctx context.Context, args ...interface{})
- func Fatalf(ctx context.Context, format string, args ...interface{})
- func Fatalln(ctx context.Context, args ...interface{})
- func Info(ctx context.Context, args ...interface{})
- func Infof(ctx context.Context, format string, args ...interface{})
- func Infoln(ctx context.Context, args ...interface{})
- func Panic(ctx context.Context, args ...interface{})
- func Panicf(ctx context.Context, format string, args ...interface{})
- func Panicln(ctx context.Context, args ...interface{})
- func Print(ctx context.Context, args ...interface{})
- func Printf(ctx context.Context, format string, args ...interface{})
- func Println(ctx context.Context, args ...interface{})
- func Warn(ctx context.Context, args ...interface{})
- func Warnf(ctx context.Context, format string, args ...interface{})
- func Warning(ctx context.Context, args ...interface{})
- func Warningf(ctx context.Context, format string, args ...interface{})
- func Warningln(ctx context.Context, args ...interface{})
- func Warnln(ctx context.Context, args ...interface{})
- func WithContext(ctx context.Context) context.Context
- func WithError(ctx context.Context, err error) context.Context
- func WithField(ctx context.Context, key string, value interface{}) context.Context
- func WithFields(ctx context.Context, fields logrus.Fields) context.Context
- func WithLogger(ctx context.Context, logger ExtendedFieldLogger) context.Context
- func WithTime(ctx context.Context, t time.Time) context.Context
- type ExtendedFieldLogger
Constants ¶
This section is empty.
Variables ¶
var Default = logrus.StandardLogger()
Default holds the logger entry returned by Entry when there is no logger in the context.
Functions ¶
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 logrus.ErrorKey as key.
func WithField ¶
WithField returns a new context derived from ctx that has a logger that always logs the given field.
func WithFields ¶
WithFields returns a new context derived from ctx that has a logger that always logs the given fields.
func WithLogger ¶
func WithLogger(ctx context.Context, logger ExtendedFieldLogger) context.Context
WithLogger returns a new context derived from ctx that is associated with the given logger.
Types ¶
type ExtendedFieldLogger ¶
type ExtendedFieldLogger interface { WithContext(ctx context.Context) *logrus.Entry WithTime(t time.Time) *logrus.Entry logrus.FieldLogger }
ExtendedFieldLogger generalizes the Entry and Logger types.
func Logger ¶
func Logger(ctx context.Context) ExtendedFieldLogger
Logger returns the logger associated with the given context. If there is no logger, it will return Default.