Documentation ¶
Overview ¶
Package logger contains util functions to get/set context to q log fields
Index ¶
Constants ¶
View Source
const ( TraceSampledJsonKey = "traceSampled" TraceIDJsonKey string = "traceId" SpanIDJsonKey string = "spanId" )
Variables ¶
View Source
var (
Logger *zap.Logger
)
Logger that is configured. It is to be used by arbitrary packages when no logger instance has been passed.
Functions ¶
func AddSpanCtx ¶
AddSpanCtx adds trace details from span context to the given context.
func AddTraceContext ¶
AddTraceContext adds trace details to the log context.
func FromContext ¶
FromContext returns a logger from given context. If context has no logger, it uses application default logger initialized in config
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.