pounce-observability
Observability wiring for POUNCE (pounce#71): the tracing subscriber
install and the bridge between the structured per-iteration event and
the JSON solve report.
This crate is kept separate from the leaf pounce-common (which holds
the pure color palette) because the collector depends on both
pounce_nlp::solve_statistics::IterRecord and tracing-subscriber.
Two output channels, one event
Each Newton iteration emits a single structured tracing event at the
pounce::iteration target ([ITER_TARGET]) carrying iter, mu,
alpha_primal, … The human terminal never sees this event — its visual
form is the colored fixed-width iteration table printed directly by
pounce-algorithm, so the text console layer filters
pounce::iteration out. Machines get it two ways:
POUNCE_LOG_FORMAT=json→ the JSON layer prints it to stderr;- the
IterCollectorLayerrebuilds anIterRecordfrom the event fields and appends it to the activeIterCaptureGuardslot, which the application drains into the solve report.
The collector skips events nested inside a restoration span, so the
report captures only the outer solve's iterations (including
'R'-marked outer iters) and not the restoration sub-solve's inner IPM
iterations — matching the pre-tracing behavior exactly.
Surface
init_subscriber()— install the global subscriber for a normal run. Idempotent (try_init), so multiple frontends or repeated Python imports are safe. ReadsRUST_LOG(filtering, defaultinfo),POUNCE_LOG_FORMAT(text|json), andNO_COLOR/CLICOLOR_FORCE(color policy). Also bridges thelogcrate intotracingso transitivelog::*call sites obeyRUST_LOG.init_for_tests()— same layers, for test setup.IterCaptureGuard::start()/.finish()— per-solve capture slot;finishreturns the collectedVec<IterRecord>.IterCollectorLayer— thetracing-subscriberlayer that reconstructs iteration records frompounce::iterationevents.iteration_event_wanted()— whether the per-iteration event should be emitted at all (true when JSON logging is on or a capture is active).ITER_TARGET/RESTORATION_SPAN— the target and span-name constants.
Environment variables
| Variable | Effect |
|---|---|
RUST_LOG |
Verbosity / per-target filtering (default info). |
POUNCE_LOG_FORMAT |
text (default) or json (structured stderr sink). |
NO_COLOR / CLICOLOR_FORCE |
Disable / force colored output. |
License
EPL-2.0.