From 77b095a8c32c423dea495f94babe49d7f169f060 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:30:33 +0000 Subject: [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 --- internal/db/bundb/hook.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'internal/db') diff --git a/internal/db/bundb/hook.go b/internal/db/bundb/hook.go index a8f225a38..16de74f11 100644 --- a/internal/db/bundb/hook.go +++ b/internal/db/bundb/hook.go @@ -22,7 +22,6 @@ import ( "time" "codeberg.org/gruf/go-kv" - "codeberg.org/gruf/go-logger/v2/level" "github.com/superseriousbusiness/gotosocial/internal/log" "github.com/uptrace/bun" ) @@ -50,7 +49,7 @@ func (queryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent) { // On trace, we log query information, // manually crafting so DB query not escaped. - case log.Level() >= level.TRACE: + case log.Level() >= log.TRACE: log.Printf("level=TRACE duration=%s query=%s", dur, event.Query) } } -- cgit v1.3