package
0.0.3
Repository: https://github.com/cpyun/cpyun-admin-core.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

DefaultClientCodeToLevel is the default implementation of gRPC return codes to log levels for client side.
DefaultCodeToLevel is the default implementation of gRPC return codes and interceptor log level for server side.
DefaultMessageProducer writes the default message.
DurationToDurationField uses a Duration field to log the request duration and leaves it up to Zap's encoder settings to determine how that is output.
DurationToTimeMillisField converts the duration to milliseconds and uses the key `grpc.time_ms`.
StreamClientInterceptor returns a new streaming client interceptor that optionally logs the execution of external gRPC calls.
StreamServerInterceptor returns a new streaming server interceptor that adds zap.Logger to the context.
UnaryClientInterceptor returns a new unary client interceptor that optionally logs the execution of external gRPC calls.
UnaryServerInterceptor returns a new unary server interceptors that adds zap.Logger to the context.
WithCodes customizes the function for mapping errors to error codes.
WithDecider customizes the function for deciding if the gRPC interceptor logs should log.
WithDurationField customizes the function for mapping request durations to Zap fields.
WithLevels customizes the function for mapping gRPC return codes and interceptor log level statements.
WithMessageProducer customizes the function for message formation.
WithTimestampFormat customizes the timestamps emitted in the log fields.

# Variables

No description provided by the author
DefaultDurationToField is the default implementation of converting request duration to a Zap field.
ServerField is used in every server-side log statement made through grpc_zap.Can be overwritten before initialization.
SystemField is used in every log statement made through grpc_zap.

# Type aliases

CodeToLevel function defines the mapping between gRPC return codes and interceptor log level.
DurationToField function defines how to produce duration fields for logging.
MessageProducer produces a user defined log message.
No description provided by the author