class

Tracing::Layer

Inherits Reference < Object

Filter combinators — FilterExt::and / ::or / ::not.

Ported from upstream tracing_subscriber::filter::combinator. The Crystal port collapses Rust's Filter trait into Layer, so these combine layers used as filters: the combinators combine enabled?, on_register_callsite (callsite Interest), and max_level_hint, and forward span lifecycle hooks to the wrapped filter(s).

Instance methods

and(other : Layer) : And

Combines two filters so a span/event is enabled only if both enable it.

Source
and_then(other : Layer) : Filtered

Compose this layer with another, where other acts as a filter.

Source
enabled?(metadata : Metadata, ctx : LayerContext) : Bool

Returns true if this layer would enable the given metadata.

Source
max_level_hint

Returns the max level hint for this layer.

Source
not

Inverts this filter: enables what it would disable and vice versa.

Source
on_close(id : Core::Span::Id, ctx : LayerContext) : Nil

Called immediately before a span is closed and removed from the registry.

Source
on_enter(id : Core::Span::Id, ctx : LayerContext) : Nil

Called when a span is entered.

Source
on_event(event : Core::Event, ctx : LayerContext) : Nil

Called when an event is recorded.

Source
on_exit(id : Core::Span::Id, ctx : LayerContext) : Nil

Called when a span is exited.

Source
on_new_span(attrs : Core::Span::Attributes, id : Core::Span::Id, ctx : LayerContext) : Nil

Called when a new span is created.

Source
on_record(id : Core::Span::Id, values : Core::Span::Record, ctx : LayerContext) : Nil

Called when fields are recorded on a span.

Source
on_record_follows_from(span : Core::Span::Id, follows : Core::Span::Id, ctx : LayerContext) : Nil

Called when a follows-from relationship is recorded.

Source
on_register_callsite(metadata : Metadata, ctx : LayerContext) : Callsite::Interest

Called when a callsite is registered.

Source
or(other : Layer) : Or

Combines two filters so a span/event is enabled if either enables it.

Source
with_fn_filter(filter : FilterFn) : Filtered
Source