Versions in this module Expand all Collapse all v0 v0.26.0 Apr 9, 2022 Changes in this version + const LogFormatJSON + const LogFormatLogfmt + var LogDecision = map[string]Decision + var MapAllowedLevels = map[string][]string + func DefaultCodeToLevel(logger log.Logger, code int) log.Logger + func DefaultCodeToLevelGRPC(c codes.Code) grpc_logging.Level + func DefaultErrorToCode(_ error) int + func DefaultFilterLogging(logger log.Logger) log.Logger + func NewGRPCOption(configYAML []byte) ([]tags.Option, []grpc_logging.Option, error) + func NewLogger(logLevel, logFormat, debugName string) log.Logger + func ParsegRPCOptions(flagDecision string, reqLogConfig *extflag.PathOrContent) ([]tags.Option, []grpc_logging.Option, error) + type CodeToLevel func(logger log.Logger, code int) log.Logger + type Decider func(methodName string, err error) Decision + type Decision int + const LogFinishCall + const LogStartAndFinishCall + const NoLogCall + func DefaultDeciderMethod(_ string, _ error) Decision + type DecisionConfig struct + LogEnd bool + LogStart bool + type DurationToFields func(duration time.Duration) Fields + type ErrorToCode func(err error) int + type Fields []string + func DurationToTimeMillisFields(duration time.Duration) Fields + type FilterLogging func(logger log.Logger) log.Logger + type GRPCProtocolConfig struct + Method string + Service string + type GRPCProtocolConfigs struct + Config []GRPCProtocolConfig + Options OptionsConfig + type HTTPProtocolConfig struct + Path string + Port uint64 + type HTTPProtocolConfigs struct + Config []HTTPProtocolConfig + Options OptionsConfig + type HTTPServerMiddleware struct + func NewHTTPServerMiddleware(logger log.Logger, opts ...Option) *HTTPServerMiddleware + func (m *HTTPServerMiddleware) HTTPMiddleware(name string, next http.Handler) http.HandlerFunc + type Option func(*options) + func NewHTTPOption(configYAML []byte) ([]Option, error) + func ParseHTTPOptions(flagDecision string, reqLogConfig *extflag.PathOrContent) ([]Option, error) + func WithDecider(f Decider) Option + func WithFilter(f FilterLogging) Option + func WithLevels(f CodeToLevel) Option + type OptionsConfig struct + Decision DecisionConfig + Level string + type RequestConfig struct + GRPC GRPCProtocolConfigs + HTTP HTTPProtocolConfigs + Options OptionsConfig + func NewRequestConfig(configYAML []byte) (*RequestConfig, error)