package log

Import Path
	github.com/opentracing/opentracing-go/log (on go.dev)

Dependency Relation
	imports 3 packages, and imported by one package

Involved Source Files field.go util.go
Package-Level Type Names (total 3)
/* sort by: | */
Encoder allows access to the contents of a Field (via a call to Field.Marshal). Tracer implementations typically provide an implementation of Encoder; OpenTracing callers typically do not need to concern themselves with it. ( Encoder) EmitBool(key string, value bool) ( Encoder) EmitFloat32(key string, value float32) ( Encoder) EmitFloat64(key string, value float64) ( Encoder) EmitInt(key string, value int) ( Encoder) EmitInt32(key string, value int32) ( Encoder) EmitInt64(key string, value int64) ( Encoder) EmitLazyLogger(value LazyLogger) ( Encoder) EmitObject(key string, value interface{}) ( Encoder) EmitString(key, value string) ( Encoder) EmitUint32(key string, value uint32) ( Encoder) EmitUint64(key string, value uint64) func Field.Marshal(visitor Encoder)
Field instances are constructed via LogBool, LogString, and so on. Tracing implementations may then handle them via the Field.Marshal method. "heavily influenced by" (i.e., partially stolen from) https://github.com/uber-go/zap Key returns the field's key. Marshal passes a Field instance through to the appropriate field-type-specific method of an Encoder. String returns a string representation of the key and value. Value returns the field's value as interface{}. Field : github.com/ChrisTrenkamp/goxpath/tree.Result Field : fmt.Stringer func Bool(key string, val bool) Field func Error(err error) Field func Event(val string) Field func Float32(key string, val float32) Field func Float64(key string, val float64) Field func Int(key string, val int) Field func Int32(key string, val int32) Field func Int64(key string, val int64) Field func InterleavedKVToFields(keyValues ...interface{}) ([]Field, error) func Lazy(ll LazyLogger) Field func Message(val string) Field func Noop() Field func Object(key string, obj interface{}) Field func String(key, val string) Field func Uint32(key string, val uint32) Field func Uint64(key string, val uint64) Field func github.com/opentracing/opentracing-go.Span.LogFields(fields ...Field)
LazyLogger allows for user-defined, late-bound logging of arbitrary data func Lazy(ll LazyLogger) Field func Encoder.EmitLazyLogger(value LazyLogger)
Package-Level Functions (total 16)
Bool adds a bool-valued key:value pair to a Span.LogFields() record
Error adds an error with the key "error.object" to a Span.LogFields() record
Event creates a string-valued Field for span logs with key="event" and value=val.
Float32 adds a float32-valued key:value pair to a Span.LogFields() record
Float64 adds a float64-valued key:value pair to a Span.LogFields() record
Int adds an int-valued key:value pair to a Span.LogFields() record
Int32 adds an int32-valued key:value pair to a Span.LogFields() record
Int64 adds an int64-valued key:value pair to a Span.LogFields() record
InterleavedKVToFields converts keyValues a la Span.LogKV() to a Field slice a la Span.LogFields().
Lazy adds a LazyLogger to a Span.LogFields() record; the tracing implementation will call the LazyLogger function at an indefinite time in the future (after Lazy() returns).
Message creates a string-valued Field for span logs with key="message" and value=val.
Noop creates a no-op log field that should be ignored by the tracer. It can be used to capture optional fields, for example those that should only be logged in non-production environment: func customerField(order *Order) log.Field { if os.Getenv("ENVIRONMENT") == "dev" { return log.String("customer", order.Customer.ID) } return log.Noop() } span.LogFields(log.String("event", "purchase"), customerField(order))
Object adds an object-valued key:value pair to a Span.LogFields() record Please pass in an immutable object, otherwise there may be concurrency issues. Such as passing in the map, log.Object may result in "fatal error: concurrent map iteration and map write". Because span is sent asynchronously, it is possible that this map will also be modified.
String adds a string-valued key:value pair to a Span.LogFields() record
Uint32 adds a uint32-valued key:value pair to a Span.LogFields() record
Uint64 adds a uint64-valued key:value pair to a Span.LogFields() record