capture

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedCapturer

type CachedCapturer struct {
	*DefaultCapturer
	// contains filtered or unexported fields
}

CachedCapturer is a capturer that caches type information.

func NewCachedCapturer

func NewCachedCapturer() *CachedCapturer

NewCachedCapturer creates a new cached capturer.

func (*CachedCapturer) TryCapture

func (d *CachedCapturer) TryCapture(value any, propertyFactory core.LogEventPropertyFactory) (*core.LogEventProperty, bool)

TryCapture attempts to capture a value using cached type information.

type CapturedField added in v0.9.0

type CapturedField struct {
	Name  string
	Value any
}

CapturedField represents a single field in a captured struct.

type CapturedStruct added in v0.9.0

type CapturedStruct struct {
	TypeName string
	Fields   []CapturedField // Preserves field order
}

CapturedStruct represents a captured struct that preserves type information and field order.

func (*CapturedStruct) MarshalJSON added in v0.9.0

func (cs *CapturedStruct) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler to output the struct as a JSON object

func (*CapturedStruct) String added in v0.9.0

func (cs *CapturedStruct) String() string

String implements fmt.Stringer to properly format the struct

type DefaultCapturer

type DefaultCapturer struct {
	// contains filtered or unexported fields
}

DefaultCapturer is the default implementation of core.Capturer.

func NewCapturer

func NewCapturer(maxDepth, maxStringLength, maxCollectionCount int) *DefaultCapturer

NewCapturer creates a capturer with custom limits.

func NewDefaultCapturer

func NewDefaultCapturer() *DefaultCapturer

NewDefaultCapturer creates a new capturer with default settings.

func (*DefaultCapturer) RegisterScalarType

func (d *DefaultCapturer) RegisterScalarType(t reflect.Type)

RegisterScalarType registers a type that should be treated as a scalar.

func (*DefaultCapturer) TryCapture

func (d *DefaultCapturer) TryCapture(value any, propertyFactory core.LogEventPropertyFactory) (prop *core.LogEventProperty, ok bool)

TryCapture attempts to capture a value into a log-friendly representation.

type Null added in v0.9.0

type Null struct{}

Null is a sentinel type for nil values that renders as "nil" in strings but null in JSON

func (Null) MarshalJSON added in v0.9.0

func (Null) MarshalJSON() ([]byte, error)

MarshalJSON returns JSON null

func (Null) String added in v0.9.0

func (Null) String() string

String returns "nil" for Go-idiomatic string representation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL