Documentation ¶
Overview ¶
Package logging provides a shared logger and log utilities to be used in all internal packages.
Index ¶
- Variables
- func IdentityAwareMiddleware() gin.HandlerFunc
- func Logger(c *gin.Context) *zap.Logger
- func Middleware() gin.HandlerFunc
- func NewLogger(level zapcore.LevelEnabler) (*zap.Logger, error)
- func SetLevel(level string) error
- func StandardErrorLog() *log.Logger
- func SugarLogger(c *gin.Context) *zap.SugaredLogger
- func WrappedLogger(c *gin.Context) *zap.Logger
- func WrappedSugarLogger(c *gin.Context) *zap.SugaredLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Level = zap.NewAtomicLevel() L, _ = NewLogger(Level) S *zap.SugaredLogger = L.Sugar() )
Functions ¶
func IdentityAwareMiddleware ¶ added in v0.5.10
func IdentityAwareMiddleware() gin.HandlerFunc
UserAwareLoggerMiddleware saves a request-specific logger to the context
func Logger ¶ added in v0.4.12
Logger gets the request-specific logger from the context If a request-specific logger cannot be found, use the default logger
func Middleware ¶ added in v0.5.10
func Middleware() gin.HandlerFunc
Middleware logs incoming requests using configured logger
func StandardErrorLog ¶ added in v0.4.6
func SugarLogger ¶ added in v0.5.9
func SugarLogger(c *gin.Context) *zap.SugaredLogger
Sugared variant of Logger
func WrappedLogger ¶ added in v0.5.9
WrappedLogger skips the most recent caller Useful for functions that logs for callers
func WrappedSugarLogger ¶ added in v0.5.9
func WrappedSugarLogger(c *gin.Context) *zap.SugaredLogger
Sugared variant of WrappedLogger
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.