Closed NIC619 closed 5 years ago
Just a note that we probably can use go-log
to classify logs, for easier parsing.
Refer to https://github.com/ethresearch/sharding-p2p-poc/issues/15
@mhchia Rebased and applied PR feedbacks(Remove ctx argument in goroutine in connectShardNodes
, Remove return value of Unsubscribe* functions
and Remove number in Node struct
). Also added an example script that makes each rpc call in sequence.
What was wrong?
go-log is ipfs's library for logging which also supports APIs similar to opentracing's. The APIs are mainly wrappers over the original opentracing APIs(though not all of them) with some extra functionalities, see doc.
Differences between go-log and opentracing:
logger.Start(ctx, "span name")
) while in opentracing it's optional(opentracing supportsopentracing.StartSpan("span name", childOf(parentSpan)
,opentracing.StartSpanFromConext(ctx, "span name", childOf(parentSpan))
)opentracing.ContextWithSpan
andopentracing.SpanFromContext
).span.setBaggageItem
which helps propagating shared information(the information shared by span and it's ancestor) to all descendant spans.Inject
andExtract
which helps propagating shared information across processes(i.e., interprocess tracing).How was it fixed?
Fatal*
withPrintf*
Cute Animal Picture