Skip to content

Commit

Permalink
Add path to understand client origin
Browse files Browse the repository at this point in the history
  • Loading branch information
mjudeikis committed Sep 8, 2023
1 parent 9209817 commit be2da71
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"net/http"
"net/http/pprof"
"os"
"path"
"runtime"
"time"

"github.com/bombsimon/logrusr/v4"
Expand Down Expand Up @@ -55,6 +57,13 @@ func main() {

logger := logrus.New()
logger.SetLevel(logrus.Level(cfg.Log.Level))
logger.SetReportCaller(true)
logger.Formatter = &logrus.TextFormatter{
CallerPrettyfier: func(f *runtime.Frame) (string, string) {
filename := path.Base(f.File)
return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("%s:%d", filename, f.Line)
},
}

client := castai.NewClient(
logger,
Expand Down

0 comments on commit be2da71

Please sign in to comment.