Versions in this module Expand all Collapse all v0 v0.1.0 Jul 13, 2026 Changes in this version + const CircularReference + const DefaultDirectoryMode + const DefaultFileMode + const DefaultMaxArrayItems + const DefaultMaxDepth + const DefaultMaxFileBytes + const DefaultMaxKeyBytes + const DefaultMaxPayloadNodes + const DefaultMaxRecordBytes + const DefaultMaxStringBytes + const MaxDepthExceeded + const Redacted + func CanonicalizeKey(key string) string + func GenerateTraceID() (string, error) + func SanitizeTraceID(traceID string) (string, bool) + type Clock interface + Monotonic func() time.Duration + Now func() time.Time + type Configuration struct + func NewConfiguration(logDirectory string, options ...Option) (Configuration, error) + func (c Configuration) DirectoryMode() fs.FileMode + func (c Configuration) FailOnError() bool + func (c Configuration) FileMode() fs.FileMode + func (c Configuration) LogDirectory() string + func (c Configuration) MaxArrayItems() int + func (c Configuration) MaxDepth() int + func (c Configuration) MaxFileBytes() int64 + func (c Configuration) MaxKeyBytes() int + func (c Configuration) MaxPayloadNodes() int + func (c Configuration) MaxRecordBytes() int + func (c Configuration) MaxStringBytes() int + func (c Configuration) RetentionDays() int + func (c Configuration) SensitiveKeys() []string + func (c Configuration) StrictSensitiveKeys() bool + func (c Configuration) TrustIncomingTraceID() bool + type ConfigurationError struct + Message string + func (e *ConfigurationError) Error() string + type Data map[string]any + type JSONLFileWriter struct + func NewJSONLFileWriter(configuration Configuration) *JSONLFileWriter + func (writer *JSONLFileWriter) Close() error + func (writer *JSONLFileWriter) Flush(ctx context.Context) error + func (writer *JSONLFileWriter) Write(ctx context.Context, event TraceEvent) (err error) + type Option func(*configValues) + func WithDirectoryMode(value fs.FileMode) Option + func WithFailOnError(value bool) Option + func WithFileMode(value fs.FileMode) Option + func WithMaxArrayItems(value int) Option + func WithMaxDepth(value int) Option + func WithMaxFileBytes(value int64) Option + func WithMaxKeyBytes(value int) Option + func WithMaxPayloadNodes(value int) Option + func WithMaxRecordBytes(value int) Option + func WithMaxStringBytes(value int) Option + func WithOnError(handler func(error)) Option + func WithRetentionDays(value int) Option + func WithSensitiveKeys(keys ...string) Option + func WithStrictSensitiveKeys(value bool) Option + func WithTrustIncomingTraceID(value bool) Option + type Sanitizer struct + func NewSanitizer(configuration Configuration) *Sanitizer + func (sanitizer *Sanitizer) Sanitize(data Data) (result Data) + type Trace struct + func (trace *Trace) Event(name string, data Data) error + func (trace *Trace) EventContext(ctx context.Context, name string, data Data) error + func (trace *Trace) Flush() error + func (trace *Trace) FlushContext(ctx context.Context) error + func (trace *Trace) ID() string + func (trace *Trace) ParentID() string + type TraceEvent struct + Data Data + Elapsed time.Duration + Name string + ParentTraceID string + Sequence uint64 + Timestamp time.Time + TraceID string + type Tracer struct + func New(logDirectory string, options ...Option) (*Tracer, error) + func NewFromConfiguration(configuration Configuration) (*Tracer, error) + func NewWithDependencies(configuration Configuration, writer Writer, clock Clock) (*Tracer, error) + func (tracer *Tracer) Close() error + func (tracer *Tracer) DroppedEventCount() uint64 + func (tracer *Tracer) Flush() error + func (tracer *Tracer) FlushContext(ctx context.Context) error + func (tracer *Tracer) Start(incomingTraceID string) (*Trace, error) + type TracingError struct + Err error + Message string + func (e *TracingError) Error() string + func (e *TracingError) Unwrap() error + type Writer interface + Close func() error + Flush func(context.Context) error + Write func(context.Context, TraceEvent) error