logging

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package logging provides a shared logger and log utilities to be used in all internal packages.

Index

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

func Logger(c *gin.Context) *zap.Logger

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 NewLogger added in v0.5.0

func NewLogger(level zapcore.LevelEnabler) (*zap.Logger, error)

func SetLevel added in v0.5.0

func SetLevel(level string) error

func StandardErrorLog added in v0.4.6

func StandardErrorLog() *log.Logger

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

func WrappedLogger(c *gin.Context) *zap.Logger

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL