Skip to content

Fixing logging example #3340

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

Closed
wants to merge 1 commit into from
Closed

Conversation

ashok-an
Copy link

@ashok-an ashok-an commented Jun 8, 2023

Description

  1. Fixing
Traceback (most recent call last):
  File "workspace/opentelemetry-python/docs/examples/logs/example.py", line 4, in <module>
    from opentelemetry._logs import set_logger_provider
ModuleNotFoundError: No module named 'opentelemetry._logs'
  1. Adding logging.warning() and logging.error() for completeness

Fixes # (issue)
ModuleNotFoundError

Type of change

  • [*] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

By running the fixed code

Does This PR Require a Contrib Repo Change?

  • [* ] No.

Checklist:

  • [*] Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

  File "workspace/opentelemetry-python/docs/examples/logs/example.py", line 4, in <module>
    from opentelemetry._logs import set_logger_provider
ModuleNotFoundError: No module named 'opentelemetry._logs'

2. Adding logging.warning() and logging.error() for completeness
@ashok-an ashok-an requested a review from a team June 8, 2023 11:05
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 8, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: ashok-an / name: Ashok Nagaraj (10ff983)

@srikanthccv
Copy link
Member

You are probably using the old version. Please update the SDK version, and the example should work fine.

See

and #3113

@ashok-an
Copy link
Author

ashok-an commented Jun 8, 2023

So it is not is /main yet? Do you suggest I close the PR as fixed/not-required?

@srikanthccv
Copy link
Member

So it is not is /main yet?

I didn't understand it. It has been quite some time since set_logger_provider moved to api (opentelemetry) package.

Do you suggest I close the PR as fixed/not-required?

Yes, this change is invalid. The example works with any version >= 1.15

@ashok-an ashok-an closed this Jun 9, 2023
@ashok-an ashok-an deleted the log-example-fix branch June 9, 2023 06:56
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.

2 participants