Python 3.12 compat.: LogRecord now has a taskName attribute by musicinmybrain · Pull Request #3557 · open-telemetry/opentelemetry-python

Description

Fixes #3370.

This fix was suggested by @mariojonke in #3370 (comment).

The taskName attribute added in Python 3.12 is documented in https://docs.python.org/3/library/logging.html#logrecord-attributes.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Patched the Fedora Linux package and confirmed that TestLoggingInit.test_logging_init_exporter now passes.

You can verify it without using Fedora by running the tests however you normally do, but using Python 3.12.

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated N/A?
  • Unit tests have been added N/A
  • Documentation has been updated N/A