Documentation ¶
Overview ¶
Package logging provides common logging infrastructure.
Index ¶
- Variables
- func Configure(level string, format string) error
- func DumpRequestResponseInterceptor(logger *zap.Logger) grpc.UnaryServerInterceptor
- func HTTPMiddleware(logger *zap.Logger, handler http.Handler) http.Handler
- func Interceptor(logger *zap.Logger) grpc.UnaryServerInterceptor
- func WithValuesFromContext(ctx context.Context, logger *zap.Logger) *zap.Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultLevel is the default log level. DefaultLevel = zap.NewAtomicLevelAt(zapcore.InfoLevel) // DefaultFormat is the default log format. DefaultFormat = FormatJSON // FormatConsole marks the console log format. FormatConsole = "console" // FormatJSON marks the JSON log format. FormatJSON = "json" // Logger is the default, system-wide logger. Logger *zap.Logger )
Functions ¶
func DumpRequestResponseInterceptor ¶
func DumpRequestResponseInterceptor(logger *zap.Logger) grpc.UnaryServerInterceptor
DumpRequestResponseInterceptor returns a grpc.UnaryServerInterceptor that logs incoming requests and corresponding responses to 'logger'.
func HTTPMiddleware ¶
HTTPMiddleware installs a logging http.Handler that logs requests and selected aspects of responses to 'logger'.
func Interceptor ¶
func Interceptor(logger *zap.Logger) grpc.UnaryServerInterceptor
Interceptor returns a grpc.UnaryServerInterceptor that logs incoming requests and associated tags to "logger".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.