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

feat: add shard information to all state & gw logging #1551

Merged
merged 2 commits into from
Sep 2, 2023

Conversation

LordOfPolls
Copy link
Contributor

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

Adds shard information to all logging.[...] calls in connection state and gateway. Ideally, this should be done in a logging adaptor or filter, however, the joys of AutoShardedClient make that a no-go. For now, this is the least disruptive way of implementing this

image

Changes

  • Create state.wrapped_logger
  • Replace all state & gateway logging calls to use state.wrapped_logger

Related Issues

Test Scenarios

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@codecov-commenter
Copy link

Codecov Report

Patch coverage is 12.00% of modified lines.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Files Changed Coverage
interactions/api/gateway/gateway.py 6.66%
interactions/api/gateway/state.py 20.00%

📢 Thoughts on this report? Let us know!.

Copy link
Contributor

@i0bs i0bs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike the wrapped_logger name, but the change is regardless good and useful.

@LordOfPolls LordOfPolls merged commit 68757ca into unstable Sep 2, 2023
8 of 11 checks passed
@LordOfPolls LordOfPolls deleted the shard-logging branch September 2, 2023 18:06
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.

3 participants