tracing: Create trace function

Simplify code slightly be creating a `trace()` function.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt
2018-08-20 17:32:16 +01:00
parent a193366b3d
commit f0073bec2f
18 changed files with 37 additions and 43 deletions

View File

@@ -9,7 +9,6 @@ package main
import (
"context"
opentracing "github.com/opentracing/opentracing-go"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
@@ -58,7 +57,7 @@ func toggle(c *cli.Context, pause bool) error {
}
func toggleContainerPause(ctx context.Context, containerID string, pause bool) (err error) {
span, _ := opentracing.StartSpanFromContext(ctx, "pause")
span, _ := trace(ctx, "pause")
defer span.Finish()
span.SetTag("pause", pause)