mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 13:12:25 -05:00
[chore] ensure consistent caller name fetching regardless of compiler inlining (#3323)
* move logging levels into log package itself * ensure inconsistent inlining doesn't mess with log calling function name * remove unused global variable * fix log level
This commit is contained in:
parent
747c251df6
commit
77b095a8c3
17 changed files with 292 additions and 204 deletions
|
|
@ -26,7 +26,6 @@ import (
|
|||
"codeberg.org/gruf/go-bytesize"
|
||||
"codeberg.org/gruf/go-errors/v2"
|
||||
"codeberg.org/gruf/go-kv"
|
||||
"codeberg.org/gruf/go-logger/v2/level"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtscontext"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
|
|
@ -99,11 +98,11 @@ func Logger(logClientIP bool) gin.HandlerFunc {
|
|||
l = l.WithFields(fields...)
|
||||
|
||||
// Default is info
|
||||
lvl := level.INFO
|
||||
lvl := log.INFO
|
||||
|
||||
if code >= 500 {
|
||||
// Actual server error.
|
||||
lvl = level.ERROR
|
||||
// Actual error.
|
||||
lvl = log.ERROR
|
||||
}
|
||||
|
||||
if len(c.Errors) > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue