From dc17855367eb0ce1ca1fed04538c8970b1c7ec4e Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 20 Sep 2020 12:08:30 +0800 Subject: [PATCH] printing context key friendly --- core/trace/tracespec/vars.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/trace/tracespec/vars.go b/core/trace/tracespec/vars.go index fa9d9dc4..4b935558 100644 --- a/core/trace/tracespec/vars.go +++ b/core/trace/tracespec/vars.go @@ -1,7 +1,12 @@ package tracespec +// TracingKey is tracing key for context +var TracingKey = contextKey("X-Trace") + // contextKey a type for context key type contextKey string -// TracingKey is tracing key for context -var TracingKey = contextKey("X-Trace") +// Printing a context will reveal a fair amount of information about it. +func (c contextKey) String() string { + return "trace/tracespec context key " + string(c) +}