Documentation ¶
Index ¶
Constants ¶
View Source
const (
// GRPCResponseLatencyKey is the amount of time needed to produce a response to a request.
GRPCResponseLatencyKey = "rpc.grpc.response_latency"
)
Variables ¶
This section is empty.
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(logger Logger) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new stream interceptor suitable for request logging.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(logger Logger) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary interceptor suitable for request logging.
Types ¶
type Logger ¶
type Logger interface { // Debug logs debug data. Debug(ctx context.Context, msg string, args ...interface{}) // Info logs info data. Info(ctx context.Context, msg string, args ...interface{}) // Warning logs warning data. Warning(ctx context.Context, msg string, args ...interface{}) // Error logs error data. Error(ctx context.Context, err error) // Critical logs critical data. Critical(ctx context.Context, err error) // Fatal logs critical data and exists current program execution. Fatal(ctx context.Context, err error) }
Logger defines how the application logs data into the system
Click to show internal directories.
Click to hide internal directories.