open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
815 stars 391 forks source link

[api/logs] Return NoopLogRecord from NoopLogger #2662

Closed yurishkuro closed 1 month ago

yurishkuro commented 1 month ago

Fixes #2656

Changes

NoopLogger was incorrectly returning nullptr, causing segfaults in client code. After this change it returns a dummy no-op log record.

yurishkuro commented 1 month ago

@marcalff then I suggest going back to allocating a new Noop record, that at least prevents the existing behavior that returns nullptr unexpectedly, and address performance issue separately.