[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:
kim
2024-09-20 13:30:33 +00:00
committed by GitHub
parent 747c251df6
commit 77b095a8c3
17 changed files with 292 additions and 204 deletions

View File

@@ -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 {