pub struct PluginTracer { /* private fields */ }Expand description
The boundary-trace sink — the LspLogger analogue. Cheap to trace into
(gate → push → publish); everything expensive is deferred to the off-thread
drain.
Implementations§
Source§impl PluginTracer
impl PluginTracer
Sourcepub fn new(default_level: TraceLevel, capacity: usize) -> Self
pub fn new(default_level: TraceLevel, capacity: usize) -> Self
Construct a tracer with default_level and a per-ring capacity.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Sensible defaults: Info (no per-call trace by default — design §7),
10k records / ring.
Sourcepub fn set_event_publisher(
&self,
publisher: Box<dyn Fn(PluginTraceRecord) + Send + Sync>,
)
pub fn set_event_publisher( &self, publisher: Box<dyn Fn(PluginTraceRecord) + Send + Sync>, )
Install / replace the event publisher (wired at boot to the runtime bus).
Sourcepub fn set_default_level(&self, level: TraceLevel)
pub fn set_default_level(&self, level: TraceLevel)
Set the default verbosity gate (:set plugin.trace-level=…). Republishes
the new level to every hot-path gate whose plugin has no override, so the
grammar trampoline picks it up on the next keystroke.
Sourcepub fn set_plugin_level(&self, plugin: u32, level: TraceLevel)
pub fn set_plugin_level(&self, plugin: u32, level: TraceLevel)
Override one plugin’s verbosity gate (a per-plugin :set / manager-view
toggle). The hot-path seam reads this, so raising one plugin’s verbosity
never touches another’s cost. Republishes to that plugin’s hot-path gate.
Sourcepub fn hot_gate(&self, plugin: u32) -> HotGate
pub fn hot_gate(&self, plugin: u32) -> HotGate
The published hot-path gate for plugin — created (seeded to the plugin’s
current effective level) on first request and cached, so repeated calls
return clones of the same atomic. The sync grammar trampoline holds one and
reads it once per guest call (design §4).
Sourcepub fn plugin_level(&self, plugin: u32) -> TraceLevel
pub fn plugin_level(&self, plugin: u32) -> TraceLevel
The effective gate for plugin — its override, else the default.
Sourcepub fn trace(&self, record: PluginTraceRecord)
pub fn trace(&self, record: PluginTraceRecord)
Append a record: gate by the plugin’s effective level, push to the per-plugin + global rings (bounded), then fire the publisher. A record above the gate is dropped before any ring work.
Sourcepub fn snapshot_plugin(&self, plugin: u32) -> Vec<PluginTraceRecord>
pub fn snapshot_plugin(&self, plugin: u32) -> Vec<PluginTraceRecord>
Snapshot one plugin’s ring (cheap clone), newest last — the seed for a per-plugin trace view.
Sourcepub fn snapshot_global(&self) -> Vec<PluginTraceRecord>
pub fn snapshot_global(&self) -> Vec<PluginTraceRecord>
Snapshot the subsystem-wide ring — the seed for the shared trace view.
Sourcepub fn forget_plugin(&self, plugin: u32)
pub fn forget_plugin(&self, plugin: u32)
Drop a plugin’s ring + gate override (on unload — reclaim its trace memory). The global ring keeps its historical records.
Auto Trait Implementations§
impl Freeze for PluginTracer
impl RefUnwindSafe for PluginTracer
impl Send for PluginTracer
impl Sync for PluginTracer
impl Unpin for PluginTracer
impl UnsafeUnpin for PluginTracer
impl UnwindSafe for PluginTracer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more