Documentation ¶
Overview ¶
Package ginzap provides log handling using zap package. Code structure based on ginrus package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ginzap ¶
Ginzap returns a gin.HandlerFunc (middleware) that logs requests using uber-go/zap on INFO level.
Requests with errors are logged using zap.Error(). Requests without errors are logged using zap.Info().
It receives:
- A time package format string (e.g. time.RFC3339).
- A boolean stating whether to use UTC time zone or local.
func OnLevel ¶
OnLevel returns a gin.HandlerFunc (middleware) that logs requests using uber-go/zap on the provided level.
Requests with errors are logged using zap.Error(). Requests without errors are logged using zap.Info().
It receives:
- A time package format string (e.g. time.RFC3339).
- A boolean stating whether to use UTC time zone or local.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.