MCPcopy
hub / github.com/grpc/grpc-go / setMethodMethodLogger

Method setMethodMethodLogger

internal/binarylog/binarylog.go:138–150  ·  view source on GitHub ↗

Set method logger for "service/method". New MethodLogger with same method overrides the old one.

(method string, ml *MethodLoggerConfig)

Source from the content-addressed store, hash-verified

136//
137// New MethodLogger with same method overrides the old one.
138func (l *logger) setMethodMethodLogger(method string, ml *MethodLoggerConfig) error {
139 if _, ok := l.config.Blacklist[method]; ok {
140 return fmt.Errorf("conflicting blacklist rules for method %v found", method)
141 }
142 if _, ok := l.config.Methods[method]; ok {
143 return fmt.Errorf("conflicting method rules for method %v found", method)
144 }
145 if l.config.Methods == nil {
146 l.config.Methods = make(map[string]*MethodLoggerConfig)
147 }
148 l.config.Methods[method] = ml
149 return nil
150}
151
152// Set blacklist method for "-service/method".
153func (l *logger) setBlacklist(method string) error {

Callers 1

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected