logger: add WithReportCaller and Clone

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2023-08-04 22:47:21 +02:00
parent 0e1fe17b97
commit 2f163ab7d1
5 changed files with 124 additions and 50 deletions

View File

@ -103,7 +103,7 @@ func run(opts ...service.Option) {
secure := true
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
log := logger.New().WithFields("service", name)
log := logger.New().WithFields("service", name).WithReportCaller(true)
ctx = logger.Set(ctx, log)
done := make(chan struct{})
ready := make(chan struct{})