Documentation
¶
Index ¶
- Variables
- func Debug() *zerolog.Event
- func Debugf(fmts string, a ...interface{})
- func DurationLoggingMiddleware(longQueryDuration int, getUserName func(context.Context) string) func(http.Handler) http.Handler
- func Error() *zerolog.Event
- func Errorf(fmts string, a ...interface{})
- func Fatal() *zerolog.Event
- func For(ctx context.Context) *zerolog.Logger
- func GetReqID(ctx context.Context) string
- func Info() *zerolog.Event
- func Infof(fmts string, a ...interface{})
- func LoggingMiddleware(longQueryDuration int, getUserName func(context.Context) string) func(http.Handler) http.Handler
- func Print(fmts string, args ...interface{})
- func RequestIDLoggingMiddleware(next http.Handler) http.Handler
- func RequestIDMiddleware(next http.Handler) http.Handler
- func SetLevel(lvalue zerolog.Level)
- func Trace() *zerolog.Event
- func TraceCheck(fn func())
- func Tracef(fmts string, a ...interface{})
- func Traceln(args ...interface{})
- func With() zerolog.Context
- func WithLogger(ctx context.Context, logger zerolog.Logger) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = zerolog.New(os.Stderr).With().Timestamp().Logger().Level(zerolog.TraceLevel)
Functions ¶
func DurationLoggingMiddleware ¶
func DurationLoggingMiddleware(longQueryDuration int, getUserName func(context.Context) string) func(http.Handler) http.Handler
Log request and duration Renamed from LoggingMiddleware
func LoggingMiddleware ¶
func LoggingMiddleware(longQueryDuration int, getUserName func(context.Context) string) func(http.Handler) http.Handler
Log request and duration
func Print ¶
func Print(fmts string, args ...interface{})
Print - simple print, without timestamp, without regard to log level.
func RequestIDLoggingMiddleware ¶
Glue between chi RequestID and Zerolog
func RequestIDMiddleware ¶
Copy of chi request id middleware
func TraceCheck ¶
func TraceCheck(fn func())
TraceCheck checks if the log level is trace before evaluating the anon fn
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.