deleted log/wrappers and add spanErr
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user