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

Fix setup logging #2555

Draft
wants to merge 1 commit into
base: 6.1
Choose a base branch
from
Draft

Fix setup logging #2555

wants to merge 1 commit into from

Conversation

sbrunner
Copy link
Member

@sbrunner sbrunner commented Dec 9, 2024

To avoid:

  File "/usr/lib/python3.12/logging/__init__.py", line 1539, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.12/logging/__init__.py", line 1684, in _log
    self.handle(record)
  File "/usr/lib/python3.12/logging/__init__.py", line 1700, in handle
    self.callHandlers(record)
  File "/venv/lib/python3.12/site-packages/sentry_sdk/integrations/logging.py", line 98, in sentry_patched_callhandlers
    return old_callhandlers(self, record)
Message: '[%s] %r'
Arguments: ('cached since 570.4s ago', {'status': 'ERROR', 'status_1': 'PENDING', 'created_at_1': datetime.datetime(2024, 12, 8, 16, 4, 28, 898425, tzinfo=datetime.timezone.utc)})
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
    ^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'write'

@sbrunner sbrunner added the backport 6.1 Backport the pull request to the '6.1' branch label Dec 9, 2024
@sbrunner sbrunner requested a review from gberaudo December 9, 2024 16:06
To avoid:
```
  File "/usr/lib/python3.12/logging/__init__.py", line 1539, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.12/logging/__init__.py", line 1684, in _log
    self.handle(record)
  File "/usr/lib/python3.12/logging/__init__.py", line 1700, in handle
    self.callHandlers(record)
  File "/venv/lib/python3.12/site-packages/sentry_sdk/integrations/logging.py", line 98, in sentry_patched_callhandlers
    return old_callhandlers(self, record)
Message: '[%s] %r'
Arguments: ('cached since 570.4s ago', {'status': 'ERROR', 'status_1': 'PENDING', 'created_at_1': datetime.datetime(2024, 12, 8, 16, 4, 28, 898425, tzinfo=datetime.timezone.utc)})
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
    ^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'write'
```
@sbrunner sbrunner added backport master Backport the pull request to the 'master' branch and removed backport 6.1 Backport the pull request to the '6.1' branch labels Dec 12, 2024
@sbrunner sbrunner changed the base branch from master to 6.1 December 12, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport master Backport the pull request to the 'master' branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant