Documentation
¶
Overview ¶
Package devlog provides a RPC call logger for ConnectRPC.
Features: - Protocol-agnostic logging (gRPC, Connect, gRPC-Web) - Structured request/response logging - Protobuf message formatting - Header and metadata support - Error diagnostics - Streaming message tracking - Thread-safe implementation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger implements connect.Interceptor for RPC call logging.
func New ¶
New creates a configured Logger instance. The provided writer must be thread-safe if shared across goroutines.
func (*Logger) WrapStreamingClient ¶
func (l *Logger) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
func (*Logger) WrapStreamingHandler ¶
func (l *Logger) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
type Option ¶
type Option func(*Logger)
Option configures Logger behavior.
func WithFormatter ¶
func WithFormatter(opts ProtoFormatter) Option
WithFormatter configures JSON, Text or other proto formatting settings.
func WithHeaderExcludes ¶
WithHeadersExcludes replaces the header value with `[** REDACTED **]`.
func WithHeaders ¶
WithHeaders enables/disables header logging (default: false).
func WithTimeFormat ¶
WithTimeFormat sets the timestamp format (default: RFC3339Nano).
type ProtoFormatter ¶
ProtoFormatter defines the interface for message formatting.