Documentation ¶
Index ¶
- Variables
- func GetLogger(ctx context.Context) logrus.FieldLogger
- func ShouldJSON(ctx context.Context, o interface{}) string
- func WithField(ctx context.Context, key string, value interface{}) context.Context
- func WithFields(ctx context.Context, fields map[string]interface{}) context.Context
- func WithLogger(ctx context.Context, logger logrus.FieldLogger) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var G = GetLogger
Functions ¶
func GetLogger ¶
func GetLogger(ctx context.Context) logrus.FieldLogger
GetLogger retrieves the current logger from the context. If no logger is available, the default logger is returned.
func ShouldJSON ¶
ShouldJSON returns JSON'd version of object, and if it cannot, it will log the error, and returns the "%+v" formatted version
func WithFields ¶
func WithLogger ¶
WithLogger returns a new context with the provided logger. Use in combination with logger.WithField(s) for great effect.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.