Skip to content

Commit

Permalink
Update header comments to match latest package functions (goadesign#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael authored Jan 12, 2024
1 parent cc13afd commit 0011c85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions log/adapt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions log/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -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=<trace-id> spanID=<span-id> message
// Output: trace_id=<trace id> span_id=<span id> message
func Span(ctx context.Context) (kvs []KV) {
spanContext := trace.SpanFromContext(ctx).SpanContext()
if spanContext.IsValid() {
Expand Down

0 comments on commit 0011c85

Please sign in to comment.