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

NoOpLoggerProvider has no force_flush in exit callback #3602

Closed
JC3 opened this issue Dec 21, 2023 · 1 comment · Fixed by #3608
Closed

NoOpLoggerProvider has no force_flush in exit callback #3602

JC3 opened this issue Dec 21, 2023 · 1 comment · Fixed by #3608
Labels
bug Something isn't working help wanted

Comments

@JC3
Copy link

JC3 commented Dec 21, 2023

Describe your environment Python 3.11, macOS Ventura

Steps to reproduce

  1. Create a LoggingHandler without providing a logger_provider, use it, and log a message.
  2. Run program

What is the expected behavior?

A clean exit.

What is the actual behavior?

Exception ignored in atexit callback: <function shutdown at 0x104e3ec00>
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 2192, in shutdown
    h.flush()
  File "/Users/pro2023/pyenv-otel/lib/python3.11/site-packages/opentelemetry/sdk/_logs/_internal/__init__.py", line 548, in flush
    self._logger_provider.force_flush()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoOpLoggerProvider' object has no attribute 'force_flush'
@iurisilvio
Copy link
Contributor

PR open with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants