summaryrefslogtreecommitdiff
path: root/vendor/github.com/opentracing/opentracing-go/ext/field.go
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2020-07-02 09:11:54 +0000
committerDaniel J Walsh <dwalsh@redhat.com>2020-07-02 06:40:04 -0400
commitc4248e62ca8721aaed1fba241a822e201327317d (patch)
tree93a98cc4f859d4b96fd594dab22768ae3d5dcd24 /vendor/github.com/opentracing/opentracing-go/ext/field.go
parente84695213e35c22ba085e3831cbd025cd55a4c84 (diff)
downloadpodman-c4248e62ca8721aaed1fba241a822e201327317d.tar.gz
podman-c4248e62ca8721aaed1fba241a822e201327317d.tar.bz2
podman-c4248e62ca8721aaed1fba241a822e201327317d.zip
Bump github.com/opentracing/opentracing-go from 1.1.0 to 1.2.0
Bumps [github.com/opentracing/opentracing-go](https://github.com/opentracing/opentracing-go) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/opentracing/opentracing-go/releases) - [Changelog](https://github.com/opentracing/opentracing-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/opentracing/opentracing-go/compare/v1.1.0...v1.2.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/opentracing/opentracing-go/ext/field.go')
-rw-r--r--vendor/github.com/opentracing/opentracing-go/ext/field.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/github.com/opentracing/opentracing-go/ext/field.go b/vendor/github.com/opentracing/opentracing-go/ext/field.go
new file mode 100644
index 000000000..8282bd758
--- /dev/null
+++ b/vendor/github.com/opentracing/opentracing-go/ext/field.go
@@ -0,0 +1,17 @@
+package ext
+
+import (
+ "github.com/opentracing/opentracing-go"
+ "github.com/opentracing/opentracing-go/log"
+)
+
+// LogError sets the error=true tag on the Span and logs err as an "error" event.
+func LogError(span opentracing.Span, err error, fields ...log.Field) {
+ Error.Set(span, true)
+ ef := []log.Field{
+ log.Event("error"),
+ log.Error(err),
+ }
+ ef = append(ef, fields...)
+ span.LogFields(ef...)
+}