Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Logging for Request Variables Using xgo #2328

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

saithsab877
Copy link
Contributor

@saithsab877 saithsab877 commented Jan 3, 2025

Describe your changes

Enhanced function call logging using xgo interceptors to provide detailed debugging information for each request. This implementation logs:

  1. Function call details:
    • File path
    • Line number
    • Function name
  2. Function arguments with their values

Example log output:

sphinx-tribes/handlers/person.go:42 GetPerson
Arguments: {
"pubkey": "abc123...",
"params": {"id": "xyz789"},
"context": {...} // internal context details omitted
}

Issue ticket number and link: #2323

Closed: #2323

The logging excludes sensitive information and internal fields while focusing on relevant request data that helps with debugging and monitoring.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested on Chrome and Firefox
  • I have tested on a mobile device
  • I have provided a screenshot or recording of changes in my PR if there were updates to the frontend

Testing Notes

  • Verified that function calls are properly logged with their arguments
  • Confirmed that sensitive data is not exposed in logs
  • Tested with various request types (GET, POST, PUT, DELETE)
  • Verified log format is consistent and readable

@kevkevinpal
Copy link
Contributor

can you add more detail to the description?

maybe add what the logging looks like and delete any irrelevant fields, this helps me review the PR and merge it quicker

@saithsab877
Copy link
Contributor Author

@kevkevinpal Done Please review this PR.

@kevkevinpal
Copy link
Contributor

do you have an example endpoint you used to test this I tried a few and am failing to get a response for the args

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.

Using xgo get the variables and their values for each request
2 participants