SkipSuccessActivityLog is a helper middleware that instructs the global activity logger to log only requests that have failed/returned an error.
()
| 327 | // SkipSuccessActivityLog is a helper middleware that instructs the global |
| 328 | // activity logger to log only requests that have failed/returned an error. |
| 329 | func SkipSuccessActivityLog() *hook.Handler[*core.RequestEvent] { |
| 330 | return &hook.Handler[*core.RequestEvent]{ |
| 331 | Id: DefaultSkipSuccessActivityLogMiddlewareId, |
| 332 | Func: func(e *core.RequestEvent) error { |
| 333 | e.Set(requestEventKeySkipSuccessActivityLog, true) |
| 334 | return e.Next() |
| 335 | }, |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | // activityLogger middleware takes care to save the request information |
| 340 | // into the logs database. |
no test coverage detected
searching dependent graphs…