diff --git a/log/adapt.go b/log/adapt.go index e09410ef..0a6d3d83 100644 --- a/log/adapt.go +++ b/log/adapt.go @@ -72,12 +72,11 @@ func AsStdLogger(ctx context.Context) *StdLogger { // // import "github.com/aws/aws-sdk-go-v2/config" // import "goa.design/clue/log" -// import "goa.design/clue/trace" // // ctx := log.Context(context.Background()) -// tracedClient := &http.Client{Transport: trace.Client(ctx, http.DefaultTransport)} +// httpc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)} // cfg, err := config.LoadDefaultConfig(ctx, -// config.WithHTTPClient(tracedClient), +// config.WithHTTPClient(httpc), // config.WithLogger(log.AsAWSLogger(ctx))) func AsAWSLogger(ctx context.Context) *AWSLogger { return &AWSLogger{ctx} diff --git a/log/span.go b/log/span.go index d1ac6cb4..d7f45247 100644 --- a/log/span.go +++ b/log/span.go @@ -6,13 +6,13 @@ import ( "go.opentelemetry.io/otel/trace" ) -// Log is a log key/value pair generator function that can be used to log trace -// and span IDs. Example: +// Span is a log key/value pair generator function that can be used to log trace +// and span IDs. Usage: // -// ctx := log.Context(ctx, WithFunc(trace.Log)) +// ctx := log.Context(ctx, WithFunc(log.Span)) // log.Printf(ctx, "message") // -// Output: traceID= spanID= message +// Output: trace_id= span_id= message func Span(ctx context.Context) (kvs []KV) { spanContext := trace.SpanFromContext(ctx).SpanContext() if spanContext.IsValid() {