...

Source file src/github.com/opentracing/opentracing-go/ext/field.go

Documentation: github.com/opentracing/opentracing-go/ext

     1  package ext
     2  
     3  import (
     4  	"github.com/opentracing/opentracing-go"
     5  	"github.com/opentracing/opentracing-go/log"
     6  )
     7  
     8  // LogError sets the error=true tag on the Span and logs err as an "error" event.
     9  func LogError(span opentracing.Span, err error, fields ...log.Field) {
    10  	Error.Set(span, true)
    11  	ef := []log.Field{
    12  		log.Event("error"),
    13  		log.Error(err),
    14  	}
    15  	ef = append(ef, fields...)
    16  	span.LogFields(ef...)
    17  }
    18  

View as plain text