Set method logger for "service/method". New MethodLogger with same method overrides the old one.
(method string, ml *MethodLoggerConfig)
| 136 | // |
| 137 | // New MethodLogger with same method overrides the old one. |
| 138 | func (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". |
| 153 | func (l *logger) setBlacklist(method string) error { |
no test coverage detected