opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

[logs] Rename LogRecordProcessor.emit to on_emit

Open hectorhdzg opened this issue 6 months ago • 2 comments

Description

Rename LogRecordProcessor.emit to on_emit to align with specification https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#onemit

Fixes #4312

Type of change

Please delete options that are not relevant.

  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update

Does This PR Require a Contrib Repo Change?

  • [ ] Yes. - Link to PR:
  • [ ] No.

hectorhdzg avatar Jun 19 '25 23:06 hectorhdzg

Thanks for another one @hectorhdzg ! I think the API should also be updated.

tammy-baylis-swi avatar Jun 20 '25 18:06 tammy-baylis-swi

Thanks for reviewing @tammy-baylis-swi, I looked into the API as well, Logger "emit" is actually the expected method name, on_emit is only applicable to LogRecordProcessors, I could be missing something though.

hectorhdzg avatar Jun 20 '25 20:06 hectorhdzg

Thanks for reviewing @tammy-baylis-swi, I looked into the API as well, Logger "emit" is actually the expected method name, on_emit is only applicable to LogRecordProcessors, I could be missing something though.

I believe this is correct.

lzchen avatar Jun 25 '25 15:06 lzchen