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:
parent
67f6b78aaa
commit
3aef3f9a07
@ -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 != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user