-
Notifications
You must be signed in to change notification settings - Fork 438
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
[API] NoopLogger causes segfault #2656
Comments
Good point. It should indeed return |
One other challenge when I tried to implement a solution is that the
|
A possible way is to implement an operator new() and operator delete() for the NoopLogRecord, that will return a static dummy on new. I agree it causes a lot of convoluted code for something that should have been very simple, but avoiding a (real) new + delete on every noop logger is worth it. |
This change ^ worked in my local internal setup (where we import OTEL into monorepo). However the other tests are failing, I am not able to debug them right now since I do not have the oss version of the build setup. |
Describe your environment v1.14.2
Steps to reproduce
What is the expected behavior?
Program should run successfully.
What is the actual behavior?
SEGV at
sample->SetAttribute
becausesample
is null.Additional context
opentelemetry-cpp/api/include/opentelemetry/logs/noop.h
Line 37 in da8e377
The NoopLogger is supposed to return usable objects, not a
nullptr
.The text was updated successfully, but these errors were encountered: