-
Notifications
You must be signed in to change notification settings - Fork 4.9k
BUILD_EASYLOGGING = OFF #6304
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
BUILD_EASYLOGGING = OFF #6304
Conversation
common/post-processing-filter.h
Outdated
|
|
||
| virtual void start( rs2::subdevice_model & model ) | ||
| { | ||
| #if BUILD_EASYLOGGINGPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave this to the end and then let's talk about it
src/rs.cpp
Outdated
| void rs2_log_to_callback_cpp( rs2_log_severity min_severity, rs2_log_callback * callback, rs2_error** error ) BEGIN_API_CALL | ||
| { | ||
| // Wrap the C++ callback interface with a shared_ptr that we set to release() it (rather than delete it) | ||
| #if BUILD_EASYLOGGINGPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have the exception already happening inside log.cpp, then no need to do it here?
src/rs.cpp
Outdated
| void rs2_log_to_callback( rs2_log_severity min_severity, rs2_log_callback_ptr on_log, void * arg, rs2_error** error ) BEGIN_API_CALL | ||
| { | ||
| // Wrap the C function with a callback interface that will get deleted when done | ||
| #if BUILD_EASYLOGGINGPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same -- can be done in one central place
src/rs.cpp
Outdated
| const char* rs2_get_full_log_message( rs2_log_message const* msg, rs2_error** error ) BEGIN_API_CALL | ||
| { | ||
| VALIDATE_NOT_NULL( msg ); | ||
| #if BUILD_EASYLOGGINGPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we define a log_message API that will centralize these #if statements?
I.e., it would look like:
log_message & wrapper = *( log_message * )( msg );
return wrapper.get_full_log_message();
And the log_message object (in log.h) would then know to throw if ELPP is not enabled.
unit-tests/log/test-c-debug.cpp
Outdated
|
|
||
| rs2_error* e = nullptr; | ||
| rs2_log_to_callback( RS2_LOG_SEVERITY_DEBUG, c_callback, nullptr, &e ); | ||
| #if BUILD_EASYLOGGINGPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we arrange it so all these tests aren't even compiled and run if ELPP is off? We can make a single new test that tests that log_to_callback throws, instead
|
General comment - having a bunch of |
5f4f663 to
1c0afd7
Compare
a680666 to
c606b30
Compare
compiles with -DBUILD_EASYLOGGINGPP=OFF and unit_tests pass
issue number: #6009