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
This commit is contained in:
Jeffrey Paul 2025-07-28 01:16:29 +02:00
parent 67f6b78aaa
commit 3aef3f9a07

View File

@ -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 != "" {