feat(output): add routable Sink for per-scan output capture#331
Conversation
pr summary2 files changed (+143 -23)
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
=======================================
Coverage ? 55.13%
=======================================
Files ? 81
Lines ? 6883
Branches ? 0
=======================================
Hits ? 3795
Misses ? 2814
Partials ? 274 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
introduce a Sink (writer plus an interactive flag) that the package-level chrome funcs delegate to via DefaultSink, and give ModuleLogger a sink it writes through. a caller can now hand a scan its own Sink so that scan's chrome lands on a dedicated writer instead of the process-wide default. default routing is unchanged: Info/Warn/Module and friends still write to the same stdout/stderr sink SetSilent configures.
drop comments on thin package-level wrappers that just forward to the Sink methods, and tighten the Sink methods' own comments to note the api-mode no-op instead of restating the func name
vmfunc
left a comment
There was a problem hiding this comment.
clean. the Interactive()/!silent gate lines up with ClearLine so a captured buffer sink won't try to animate, and the isolation test (TestSinkDoesNotLeakToDefault) covers the thing that actually matters for per-target capture.
one thing to keep in the back of your head: Module() now snapshots the writer at construction via DefaultSink(), where the old ModuleLogger read the global sink at write time. package funcs still track it live. today it's fine because SetSilent runs once at startup before any output.Module() call, but if we ever toggle silent mid-run, loggers built before the toggle keep the old writer. not blocking, just noting it. in.
introduce a Sink (writer plus an interactive flag) that the package-level
chrome funcs delegate to via DefaultSink, and give ModuleLogger a sink it
writes through. a caller can now hand a scan its own Sink so that scan's
chrome lands on a dedicated writer instead of the process-wide default.
default routing is unchanged: Info/Warn/Module and friends still write to
the same stdout/stderr sink SetSilent configures.