Documentation ¶
Index ¶
- func SetLogger(opts ...Option) gin.HandlerFunc
- type Fn
- type Option
- func WithClientErrorLevel(lvl zerolog.Level) Option
- func WithDefaultLevel(lvl zerolog.Level) Option
- func WithLogger(fn func(*gin.Context, zerolog.Logger) zerolog.Logger) Option
- func WithOutputFormat(s io.Writer) Option
- func WithServerErrorLevel(lvl zerolog.Level) Option
- func WithSkipPath(s []string) Option
- func WithSkipPathRegexp(s *regexp.Regexp) Option
- func WithUTC(s bool) Option
- func WithWriter(s io.Writer) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogger ¶
func SetLogger(opts ...Option) gin.HandlerFunc
SetLogger initializes the logging middleware.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option specifies instrumentation configuration options.
func WithClientErrorLevel ¶
func WithDefaultLevel ¶
func WithLogger ¶
WithLogger set custom logger func
func WithOutputFormat ¶
WithOutputFormat changes the format of the output. This is confusingly named / implemented since it takes a writer interface as well. It corresponds to the zerolog.Output() function. It defaults to using zerolog.ConsoleWriter with the writer provided by WithWriter.
func WithServerErrorLevel ¶
func WithSkipPath ¶
WithSkipPath skip URL path by specfic pattern
func WithSkipPathRegexp ¶
WithSkipPathRegexp skip URL path by regexp pattern
func WithWriter ¶
WithWriter change the default output writer. Default is gin.DefaultWriter
Click to show internal directories.
Click to hide internal directories.