Skip to content

feat(output): add routable Sink for per-scan output capture#331

Merged
vmfunc merged 2 commits into
vmfunc:mainfrom
TBX3D:feat/output-sink
Jul 22, 2026
Merged

feat(output): add routable Sink for per-scan output capture#331
vmfunc merged 2 commits into
vmfunc:mainfrom
TBX3D:feat/output-sink

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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.

@TBX3D
TBX3D requested a review from vmfunc as a code owner July 4, 2026 01:53
@github-actions github-actions Bot added tests test changes size/m <200 lines changed labels Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

pr summary

2 files changed (+143 -23)

category files
go source 2
tests 1

@codecov-commenter

codecov-commenter commented Jul 4, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 70.37037% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7ea1cd2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/output/output.go 70.37% 8 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@TBX3D
TBX3D force-pushed the feat/output-sink branch from b8ef3de to 8eace63 Compare July 4, 2026 02:35
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 vmfunc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vmfunc
vmfunc merged commit 281e59c into vmfunc:main Jul 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m <200 lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants