Fix exception thrown when LoggerProvider not configured by lzchen · Pull Request #3423 · open-telemetry/opentelemetry-python

Conversation

@lzchen

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.")
...

srikanthccv

srikanthccv

Choose a reason for hiding this comment

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

Some minor comments

srikanthccv

Choose a reason for hiding this comment

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

Thank you

2 participants

@lzchen @srikanthccv