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 exception thrown when LoggerProvider not configured #3423

Merged
merged 9 commits into from
Sep 7, 2023

Conversation

lzchen
Copy link
Contributor

@lzchen lzchen commented Sep 1, 2023

If a LoggerHandler is instantiated without an SDK LoggerProvider, an exception is thrown here since NoOpLogger does not have the resource attribute.

Repro:

...
# do not set SDK Loggerprovider

handler = LoggingHandler(level=logging.NOTSET)
logging.getLogger().addHandler(handler)
logging.info("Jackdaws love my big sphinx of quartz.")
...

@lzchen lzchen requested a review from a team as a code owner September 1, 2023 20:45
Copy link
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

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

Some minor comments

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

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

Thank you

@lzchen lzchen merged commit 6070a0d into open-telemetry:main Sep 7, 2023
111 checks passed
@lzchen lzchen deleted the logs branch September 7, 2023 15:30
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.

None yet

2 participants