Documentation ¶
Overview ¶
Package logger contains helpers for logging. This is mostly thin wrappers around the zap logging package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(level string) (*zap.SugaredLogger, error)
Build builds a logger with the specified log level.
func Get ¶
func Get(ctx context.Context) *zap.SugaredLogger
Get returns the logger in context, if there is one. If there isn't, it returns the global logger.
func Middleware ¶
Middleware is a middleware that logs the start and end of each request, along with some useful data about what was requested, what the response status was, and how long it took to return.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.