(opt string)
| 109 | } |
| 110 | |
| 111 | func parseMethodLogCfg(opt string) (string, methodLogConfig) { |
| 112 | optParts := strings.SplitN(opt, ":", 2) |
| 113 | methodName := optParts[0] |
| 114 | if len(optParts) == 1 { |
| 115 | return methodName, methodLogConfig{IgnoreSuccess: true} |
| 116 | } |
| 117 | ignoredErrors := strings.Split(optParts[1], ";") |
| 118 | isSuccessIgnored := ignoredErrors[0] == "" |
| 119 | if isSuccessIgnored { |
| 120 | ignoredErrors = ignoredErrors[1:] |
| 121 | } |
| 122 | ignoredErrorSet := make(map[string]struct{}, len(ignoredErrors)) |
| 123 | for _, ignoredMethodError := range ignoredErrors { |
| 124 | ignoredErrorSet[ignoredMethodError] = struct{}{} |
| 125 | } |
| 126 | return methodName, methodLogConfig{ |
| 127 | IgnoreSuccess: isSuccessIgnored, |
| 128 | IgnoredErrors: ignoredErrorSet, |
| 129 | } |
| 130 | } |
no outgoing calls