packagelogimport("context""github.com/sirupsen/logrus""go.opencensus.io/trace")// G returns a `logrus.Entry` with the `TraceID, SpanID` from `ctx` if `ctx`// contains an OpenCensus `trace.Span`.funcG(ctxcontext.Context)*logrus.Entry{span:=trace.FromContext(ctx)ifspan!=nil{sctx:=span.SpanContext()returnlogrus.WithFields(logrus.Fields{"traceID":sctx.TraceID.String(),"spanID":sctx.SpanID.String(),// "parentSpanID": TODO: JTERRY75 - Try to convince OC to export this?})}returnlogrus.NewEntry(logrus.StandardLogger())}