mirror of
https://github.com/containers/skopeo.git
synced 2025-08-29 19:42:47 +00:00
Bumps [github.com/containers/buildah](https://github.com/containers/buildah) from 1.11.4 to 1.11.5. - [Release notes](https://github.com/containers/buildah/releases) - [Changelog](https://github.com/containers/buildah/blob/master/CHANGELOG.md) - [Commits](https://github.com/containers/buildah/compare/v1.11.4...v1.11.5) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
24 lines
581 B
Go
24 lines
581 B
Go
package log
|
|
|
|
import (
|
|
"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`.
|
|
func G(ctx context.Context) *logrus.Entry {
|
|
span := trace.FromContext(ctx)
|
|
if span != nil {
|
|
sctx := span.SpanContext()
|
|
return logrus.WithFields(logrus.Fields{
|
|
"traceID": sctx.TraceID.String(),
|
|
"spanID": sctx.SpanID.String(),
|
|
// "parentSpanID": TODO: JTERRY75 - Try to convince OC to export this?
|
|
})
|
|
}
|
|
return logrus.NewEntry(logrus.StandardLogger())
|
|
}
|