trace: Add missing log message

Add a log message for every trace span created, required by the tracing
tests to validate tracing is working.

Fixes: #1814.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2019-06-19 11:46:13 +01:00
parent 1858c4da2c
commit b3ab9cafc1

View File

@ -88,5 +88,12 @@ func Trace(parent context.Context, name string) (opentracing.Span, context.Conte
span.SetTag("source", "runtime") span.SetTag("source", "runtime")
span.SetTag("component", "cli") span.SetTag("component", "cli")
// This is slightly confusing: when tracing is disabled, trace spans
// are still created - but the tracer used is a NOP. Therefore, only
// display the message when tracing is really enabled.
if tracing {
kataUtilsLogger.Debugf("created span %v", span)
}
return span, ctx return span, ctx
} }