mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-24 10:15:47 +03:00
[feature] attach any request errors if found, only set level=ERROR if code >= 500 (#2300)
This commit is contained in:
parent
c7b6cd7770
commit
ece2e795e0
1 changed files with 6 additions and 2 deletions
|
@ -87,9 +87,13 @@ func Logger(logClientIP bool) gin.HandlerFunc {
|
|||
lvl := level.INFO
|
||||
|
||||
if code >= 500 {
|
||||
// This is a server error
|
||||
// Actual server error.
|
||||
lvl = level.ERROR
|
||||
l = l.WithField("error", c.Errors)
|
||||
}
|
||||
|
||||
if len(c.Errors) > 0 {
|
||||
// Always attach any found errors.
|
||||
l = l.WithField("errors", c.Errors)
|
||||
}
|
||||
|
||||
// Get appropriate text for this code.
|
||||
|
|
Loading…
Reference in a new issue