(format string, v ...any)
| 139 | } |
| 140 | |
| 141 | func (l *osinLogger) Printf(format string, v ...any) { |
| 142 | logger := log.FromContext(l.ctx) |
| 143 | if strings.HasPrefix(format, osinErrorFormat) && len(v) >= 2 { |
| 144 | format = strings.TrimPrefix(format, osinErrorFormat) |
| 145 | logger = logger.WithField("oauth_error", v[0]) |
| 146 | if err, ok := v[1].(error); ok { |
| 147 | logger = logger.WithField("oauth_error_cause", err) |
| 148 | } |
| 149 | v = v[2:] |
| 150 | if len(v) >= 1 { |
| 151 | switch format { |
| 152 | case osinAuthCodeErrorFormat: |
| 153 | logger.WithField("oauth_error_message", v[0]).Warn("OAuth authorization_code error") |
| 154 | return |
| 155 | case osinRefreshTokenErrorFormat: |
| 156 | logger.WithField("oauth_error_message", v[0]).Warn("OAuth refresh_token error") |
| 157 | return |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | logger.Warnf("OAuth internal error: "+format, v...) |
| 162 | } |
| 163 | |
| 164 | // These errors map to errors in the osin library. |
| 165 | var ( |
nothing calls this directly
no test coverage detected