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

@@ -12,7 +12,6 @@ import (
vc "github.com/kata-containers/runtime/virtcontainers"
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
opentracing "github.com/opentracing/opentracing-go"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
@@ -48,7 +47,7 @@ var startCLICommand = cli.Command{
}
func start(ctx context.Context, containerID string) (vc.VCSandbox, error) {
span, _ := opentracing.StartSpanFromContext(ctx, "start")
span, _ := trace(ctx, "start")
defer span.Finish()
kataLog = kataLog.WithField("container", containerID)