Skip to content

Add structured debug log to ownership update service - #497

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
10xwhoman:feat/ownership-update-structured-log
Jun 26, 2026
Merged

Add structured debug log to ownership update service#497
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
10xwhoman:feat/ownership-update-structured-log

Conversation

@10xwhoman

Copy link
Copy Markdown
Contributor

Summary

  • Adds structured Pino logger.debug call to updateOwnership in ownership.service.ts
  • Logs creator_id, masked wallet_address (first 4 + last 4 chars), previous_balance, new_balance, event_type, and ledger_sequence
  • Pre-fetches existing balance before upsert to capture the before-value
  • Adds 5 unit tests covering all fields, address masking, create path, sell event type, and no-log-on-failure

Test plan

  • npm test -- ownership-update-log passes (5 tests)
  • Log output confirmed masked — full wallet address never appears in structured log

Closes #492

updateOwnership now emits a pino debug log after each successful write
with all six fields from issue accesslayerorg#492:
  - creator_id
  - wallet_address (masked: first 4 + last 4 chars only)
  - previous_balance (0 when the row is newly created)
  - new_balance
  - event_type ('buy' | 'sell', optional from caller)
  - ledger_sequence (optional from caller)

No log is emitted if the upsert throws. Unit tests cover all six fields,
masking, the create path (previous=0), sell event, and no-log-on-failure.

Closes accesslayerorg#492
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@10xwhoman Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit dc76356 into accesslayerorg:main Jun 26, 2026
1 check passed
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 structured log for ownership read model update after each indexed trade event

2 participants