@@ -22,13 +22,14 @@ const (
2222
2323// Config defines parameters for the logger
2424type Config struct {
25- Level string `mapstructure:"level"`
26- Stats bool `mapstructure:"stats"`
25+ Level string `mapstructure:"level"`
26+ Stats bool `mapstructure:"stats"`
27+ Fix []string `mapstructure:"fix"`
2728}
2829
2930// Init initializes the package logger.
3031// Supported levels are: ["debug", "info", "warn", "error"]
31- func Init (level string ) {
32+ func Init (level string , fix [] string ) {
3233 l := zerolog .GlobalLevel ()
3334 switch level {
3435 case "trace" :
@@ -53,7 +54,13 @@ func Init(level string) {
5354 output .FormatMessage = func (i interface {}) string {
5455 caller , file , line , _ := runtime .Caller (9 )
5556 fileName := filepath .Base (file )
56- if fileName == "asm_amd64.s" || fileName == "proc.go" {
57+ var needfix bool
58+ for _ , b := range fix {
59+ if strings .Contains (fileName , b ) {
60+ needfix = true
61+ }
62+ }
63+ if needfix {
5764 caller , file , line , _ = runtime .Caller (8 )
5865 fileName = filepath .Base (file )
5966 }
0 commit comments