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 SetLevel(l string) error
- func SetServerLogger()
- 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 ¶
var ( L = newLogger(level, os.Stderr) 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 SetServerLogger ¶ added in v0.9.0
func SetServerLogger()
SetServerLogger changes L and S to a logger that is appropriate for long running processes like the api server and connectors. The logger uses json format and includes the function name and line number in the log message.
SetServerLogger should not be called concurrently. It should be called before any goroutines that may use the logger are started.
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.