refactor(proxy): share the logger formatting core instead of an inlined copy - #3050
Merged
Conversation
…ed copy proxy/logger.ts re-inlined ~130 lines of formatting primitives from utils/logger/core.ts behind a "keep in sync" comment whose stated reason (a Docker build that only copies src/proxy/) no longer exists: there is no proxy Dockerfile in this repo or veryfront-infrastructure, the proxy ships in the single deno compile binary, and proxy/*.ts already imports many #veryfront/* modules. The copies had also already drifted: the proxy version printed key=undefined context entries that core.ts filters out. Import the shared core (a dependency-free leaf) and delete the copy. The undefined-filtering behavior of core.ts now applies to proxy text logs.
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the proxy logger to reuse the shared logger formatting utilities from #veryfront/utils/logger/core.ts, removing the previously inlined (and drifting) copy of formatting code inside the proxy module. This aligns proxy text-log formatting behavior with the shared core, including filtering undefined context values.
Changes:
- Replace ~130 lines of inlined formatting primitives in
src/proxy/logger.tswith imports from#veryfront/utils/logger/core.ts. - Reuse the shared
LogLevelNametype for the proxy logger’sLogLevel. - Proxy text logs now filter out
undefinedcontext entries (JSON logs already avoided emitting empty context).
Verification (as reported in PR description):
deno task verify:quick(exit 0)deno task test:unit(2634 passed / 0 failed)- Proxy test suite (35 test files / 284 steps, 0 failed)
- Pre-push (fmt + full suite) passed
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kwakayama
enabled auto-merge (squash)
July 24, 2026 05:08
kwakayama
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Candidate #7 from the architecture review.
proxy/logger.tsre-inlined ~130 lines of formatting primitives fromutils/logger/core.tsbehind a manual "keep in sync" comment. Net: −104 lines (+34/−138).The gating question, answered
The inline comment claimed the proxy Docker build only copies
src/proxy/and cannot reachsrc/utils/. Verified stale:veryfront-infrastructure/deno compilebinary (deno task start-split:binary)proxy/*.tsalready imports many#veryfront/*modules today (errors,observability,platform/compat,utilsvia earlier consolidations) — a proxy-only-copy build would already be brokenThe drift the comment failed to prevent
The copies had already diverged: core's
formatContextTextfiltersundefinedcontext values; the proxy copy printedkey=undefined. With the shared core, proxy text logs now filter undefined entries too (JSON logs unaffected). This is the one intentional behavior delta.utils/logger/core.tsis a dependency-free leaf (imports nothing), so no cycle risk; module-boundary lint passes.Verification
deno task verify:quickexit 0 ·deno task test:unit2634 passed / 0 failed · pre-push (fmt + full suite) passed