Skip to content

feat: structured debug log prefixes#20

Merged
maastrich merged 1 commit intomainfrom
feat/debug-log-prefixes
Apr 24, 2026
Merged

feat: structured debug log prefixes#20
maastrich merged 1 commit intomainfrom
feat/debug-log-prefixes

Conversation

@maastrich
Copy link
Copy Markdown
Owner

Summary

At --log-level debug the hasher now emits one line per event, each starting with a bracketed tag at column zero so users can filter with `grep`:

  • `[hash]: ` — a file's content was read and its sha256 computed.
  • `[import]: -> "" -> ` — a static import was resolved. Unresolved specifiers show `` in the third slot.
  • `[skip]: ` — a resolved path was skipped because it lives in `node_modules`.
hashup -l debug 2>&1 | grep '^\[hash\]:'
hashup -l debug 2>&1 | grep '<unresolved>'
hashup -l debug 2>&1 | grep -c '^\[skip\]:'

Test plan

  • New `tests/debug-logs.test.ts` — asserts each prefix is present on a fixture with one hashed file, one resolved import, and one node_modules skip; asserts every debug line starts with one of the three prefixes at column zero; asserts `warn` suppresses all three
  • `vp test` — 120/120 passing
  • `vp check` clean
  • Smoke tested against bfront webapps/lcm — 2056 `[hash]`, 6402 `[import]`, 1209 `[skip]` events, 115 MB peak RSS, ~1 s wall time

Docs

`docs/guide/how-it-works.md` → new "Debug-level prefixes" section with the table and `grep` recipes.

🤖 Generated with Claude Code

Emit one [hash]:, [import]:, [skip]: line per event at debug level so
users can filter with grep. Logged at column zero; source, specifier,
and resolved path embedded in [import]: for quick triage of
unresolved or unexpected resolutions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

📖 Docs preview: https://maastrich.github.io/hashup/branches/pr-20/

@maastrich maastrich merged commit 7aec2ca into main Apr 24, 2026
3 checks passed
@maastrich maastrich deleted the feat/debug-log-prefixes branch April 24, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant