lib/jaeger/client/span_context.rb in jaeger-client-0.6.0 vs lib/jaeger/client/span_context.rb in jaeger-client-0.6.1
- old
+ new
@@ -41,18 +41,19 @@
def debug?
@flags & Flags::DEBUG == Flags::DEBUG
end
- def inspect
- to_s
+ def to_trace_id
+ @to_trace_id ||= @trace_id.to_s(16)
end
- def to_s
- "#<SpanContext @span_id=#{span_id.to_s(16)} " \
- "@parent_id=#{parent_id.to_s(16)} " \
- "@trace_id=#{trace_id.to_s(16)} " \
- "@flags=#{flags}>"
+ def to_parent_id
+ @to_parent_id ||= @parent_id.zero? ? nil : @parent_id.to_s(16)
+ end
+
+ def to_span_id
+ @to_span_id ||= @span_id.to_s(16)
end
end
end
end