Documentation
¶
Index ¶
Constants ¶
View Source
const (
// RequestIDKey is the key used to store request IDs in context
RequestIDKey contextKey = "request_id"
)
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext extracts a logger with request context
func StreamServerInterceptor ¶
func StreamServerInterceptor() grpc.StreamServerInterceptor
StreamServerInterceptor returns a gRPC interceptor for streaming request logging
func UnaryServerInterceptor ¶
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
LoggingInterceptor returns a gRPC interceptor for request logging
Types ¶
type Config ¶
type Config struct {
// Level is the logging level (debug, info, warn, error)
Level string
// Pretty determines if logs should be formatted for human readability
Pretty bool
// Output is where logs are written (defaults to os.Stdout)
Output io.Writer
}
Config defines logging configuration
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default logging configuration
Click to show internal directories.
Click to hide internal directories.