deleted log/wrappers and add spanErr
Some checks failed
lint / lint (pull_request) Has been cancelled
pr / test (pull_request) Has been cancelled

This commit is contained in:
2024-10-10 17:56:20 +03:00
parent c1e3e9c5a2
commit 3d406bfb22
2 changed files with 3 additions and 415 deletions

View File

@@ -400,6 +400,9 @@ func (s *slogLogger) printLog(ctx context.Context, lvl logger.Level, attrs ...in
ve, hasErr := msg.(error)
if hasErr && ve != nil {
attrs = append(attrs, slog.String(s.opts.ErrorKey, ve.Error()))
if span, ok := tracer.SpanFromContext(ctx); ok {
span.SetStatus(tracer.SpanStatusError, ve.Error())
}
}
for _, fn := range s.opts.ContextAttrFuncs {