Skip to content

feat: migrate to new backend logging convention#34

Merged
AquiGorka merged 2 commits into
mainfrom
backend-logging-convention
May 31, 2026
Merged

feat: migrate to new backend logging convention#34
AquiGorka merged 2 commits into
mainfrom
backend-logging-convention

Conversation

@AquiGorka
Copy link
Copy Markdown
Contributor

Summary

Adopts the convention defined in local-dev/logging.md. Part of the 4-repo backend logging migration.

  • New Logger at src/utils/logger/index.ts — TS port of AquiGorka/go-logger. Five methods (info, event, debug, error, scope), four levels.
  • src/config/logger.ts exports createLogger(). No module-level singleton.
  • Service-injection refactor: provider-auth, wallet-auth, payment-session, discord-notify free functions take { log } deps; scope internally.
  • HTTP route handler factories: every handler (auth/challenge, auth/verify, account/, admin/councils/, pay/instant/*, utxo/post) becomes handle<X>(deps). Sub-routers (auth, account, admin, utxo, pay, waitlist) become buildXRouter(deps).
  • Middleware factories: appendRequestIdMiddleware, adminMiddleware take { log }.
  • All 28 LOG calls + 2 stray console.warn calls migrated. LOG.trace dropped (no equivalent).
  • No OTEL changeswithSpan, span events, trace-context middleware preserved.

Logging coverage

Subsystem Levels emitted
HTTP routes (auth, account, admin/councils, pay/instant, utxo) info, event, debug, error
Middleware (requestId, admin auth) event, debug, error
Services (wallet-auth, provider-auth, payment-session) info, event, debug, error
External APIs (provider-platform, Discord) info, event, debug, error
Error paths error

Verified locally (pre-push)

  • deno fmt --check: clean
  • deno lint: clean
  • deno task test:unit: 21 passed, 0 failed
  • grep -rn 'LOG\.(...)' src/: 0 hits
  • grep -rn 'console\.(...)' src/ (excl logger module): 0 hits

Test plan

  • CI green
  • Merge after local-dev PR #100 (convention doc) lands

@AquiGorka AquiGorka force-pushed the backend-logging-convention branch from b74f26b to 1127550 Compare May 31, 2026 16:46
@AquiGorka AquiGorka merged commit 410ceeb into main May 31, 2026
7 checks passed
@AquiGorka AquiGorka deleted the backend-logging-convention branch May 31, 2026 19:02
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