BUILD_EASYLOGGING = OFF - #6304
Conversation
|
|
||
| virtual void start( rs2::subdevice_model & model ) | ||
| { | ||
| #if BUILD_EASYLOGGINGPP |
There was a problem hiding this comment.
Leave this to the end and then let's talk about it
| 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.
If we have the exception already happening inside log.cpp, then no need to do it here?
| 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.
Same -- can be done in one central place
| 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.
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.
|
|
||
| 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.
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