Documentation ¶
Index ¶
- Constants
- func Debug(message string, args ...KeyValue)
- func DebugWithContext(spanCtx *trace.SpanContext, message string, args ...KeyValue)
- func Error(err error, message string, args ...KeyValue)
- func ErrorWithContext(spanCtx *trace.SpanContext, err error, message string, args ...KeyValue)
- func Fatal(err error, message string, args ...KeyValue)
- func FatalWithContext(spanCtx *trace.SpanContext, err error, message string, args ...KeyValue)
- func Info(message string, args ...KeyValue)
- func InfoWithContext(spanCtx *trace.SpanContext, message string, args ...KeyValue)
- func Initialize(level zerolog.Level, attribs attributes.Attributes, writer io.Writer) (err error)
- func MergeMaps(m1 map[string]any, m2 map[string]any) map[string]any
- func Panic(err error, message string, args ...KeyValue)
- func PanicWithContext(spanCtx *trace.SpanContext, err error, message string, args ...KeyValue)
- func Warn(message string, args ...KeyValue)
- func WarnWithContext(spanCtx *trace.SpanContext, message string, args ...KeyValue)
- type KeyValue
Constants ¶
const ( TraceIDAttr = "otel.trace_id" SpanIDAttr = "otel.span_id" )
Variables ¶
This section is empty.
Functions ¶
func DebugWithContext ¶
func DebugWithContext(spanCtx *trace.SpanContext, message string, args ...KeyValue)
DebugWithContext logs a debug message and adds the trace id and span id fount in the ctx. The args are key value pairs and are optional.
func ErrorWithContext ¶
func ErrorWithContext(spanCtx *trace.SpanContext, err error, message string, args ...KeyValue)
ErrorWithContext logs an error message and adds the trace id and span id fount in the ctx.
func FatalWithContext ¶
func FatalWithContext(spanCtx *trace.SpanContext, err error, message string, args ...KeyValue)
FatalWithContext logs a fatal message and adds the trace id and span id fount in the ctx.
func InfoWithContext ¶
func InfoWithContext(spanCtx *trace.SpanContext, message string, args ...KeyValue)
InfoWithContext logs an info message and adds the trace id and span id fount in the ctx. The args are key value pairs and are optional.
func Initialize ¶
func Initialize(level zerolog.Level, attribs attributes.Attributes, writer io.Writer) (err error)
Initialize initializes the logging system. It returns a logger that can be used to log messages, though it is not required.
func PanicWithContext ¶
func PanicWithContext(spanCtx *trace.SpanContext, err error, message string, args ...KeyValue)
func WarnWithContext ¶
func WarnWithContext(spanCtx *trace.SpanContext, message string, args ...KeyValue)
WarnWithContext logs a warning message and adds the trace id and span id fount in the ctx. The args are key value pairs and are optional.