Documentation
¶
Index ¶
- Constants
- Variables
- func AddHook(hook logrus.Hook)
- func FromContext(ctx context.Context) *logrus.Entry
- func FromRequest(r *http.Request) *logrus.Entry
- func Handler() gin.HandlerFunc
- func Middleware(next http.Handler) http.Handler
- func WithContext(ctx context.Context, logger *logrus.Entry) context.Context
- func WithRequestID(next http.Handler) http.Handler
Constants ¶
View Source
const ( RequestIdHeaderKey = "X-Request-Id" RequestIdLogKey = "request-id" ExposeHeaderKey = "Access-Control-Expose-Headers" )
Variables ¶
View Source
var L = logrus.NewEntry(logrus.StandardLogger())
L is an alias for the the standard logger.
Functions ¶
func FromContext ¶
FromContext retrieves the current logger from the context. If no logger is available, the default logger is returned.
func FromRequest ¶
FromRequest retrieves the current logger from the request. If no logger is available, the default logger is returned.
func Handler ¶
func Handler() gin.HandlerFunc
func Middleware ¶
Middleware provides logging middleware.
func WithContext ¶
WithContext 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.