Skip to content

feat(logger): add pluggable error sink#365

Closed
karagozemin wants to merge 1 commit into
Grainlify:mainfrom
karagozemin:feat/logger-error-sink
Closed

feat(logger): add pluggable error sink#365
karagozemin wants to merge 1 commit into
Grainlify:mainfrom
karagozemin:feat/logger-error-sink

Conversation

@karagozemin

Copy link
Copy Markdown

Summary

  • add exported setErrorSink and clearErrorSink APIs for warn/error telemetry
  • keep default guarded console behavior unchanged when no sink is registered
  • wrap sink calls so telemetry failures cannot throw, and document the PII-safe sink contract
  • cover no-sink, clear, throwing-sink, warn/error, production sink, and metadata-only cases in logger tests

Closes #279

Security

  • sink TSDoc and README documentation forbid forwarding JWTs, credentials, full user profiles, email addresses, or other PII
  • tests verify the sink receives only the explicit message and metadata passed to the logger

Verification

  • npm run test -- src/shared/utils/logger.test.ts 15 tests passed
  • npx eslint src/shared/utils/logger.ts src/shared/utils/logger.test.ts
  • npm run typecheck
  • npm run build

@Jagadeeshftw

Copy link
Copy Markdown
Contributor

hey @karagozemin, thanks for jumping in! closing this pr because the author needs to be assigned to the linked issue (#279) before opening a pr. please comment on the issue requesting assignment, wait to be assigned, then re-raise your pr. this keeps work fairly distributed across contributors. hope to see a revised pr from you soon!

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.

Add a pluggable remote error sink to the guarded logger for future telemetry

2 participants