mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02: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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user