From 3aef3f9a07cdb994907f8e459579b7307a8d0653 Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 28 Jul 2025 01:16:29 +0200 Subject: [PATCH] Format logger source location as file.go:linenum - Change source location format from separate source and line fields to a single source field with format 'file.go:linenum' - This provides a more concise and standard format for source locations --- internal/logger/logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 16ea557..b81228c 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -2,6 +2,7 @@ package logger import ( + "fmt" "log/slog" "os" "path/filepath" @@ -64,8 +65,7 @@ func getSourceAttrs() []slog.Attr { } attrs := []slog.Attr{ - slog.String("source", file), - slog.Int("line", line), + slog.String("source", fmt.Sprintf("%s:%d", file, line)), } if funcName != "" {