1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-27 22:49:15 +02:00

Revert "Remove log interface from Span." (#21)

This reverts commit a551f0298c.
This commit is contained in:
rghetia
2019-06-24 10:35:16 -07:00
committed by GitHub
parent 73b844930c
commit abccacef85
7 changed files with 95 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ import (
"google.golang.org/grpc/codes"
"github.com/open-telemetry/opentelemetry-go/api/core"
"github.com/open-telemetry/opentelemetry-go/api/log"
"github.com/open-telemetry/opentelemetry-go/api/scope"
"github.com/open-telemetry/opentelemetry-go/api/tag"
"github.com/open-telemetry/opentelemetry-go/exporter/observer"
@@ -89,6 +90,7 @@ func (t *tracer) WithSpan(ctx context.Context, name string, body func(context.Co
if err := body(ctx); err != nil {
span.SetAttribute(ErrorKey.Bool(true))
log.Log(ctx, "span error", MessageKey.String(err.Error()))
return err
}
return nil