Check for NDEBUG in logInfo [12218] #2089
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As it is right now,
logInfo
only produces messages under the following conditions:HAVE_LOG_NO_INFO
is false ANDFASTDDS_ENFORCE_LOG_INFO
is defined OR__INTERNALDEBUG
or_INTERNALDEBUG
is defined AND_DEBUG
or__DEBUG
is defined.HAVE_LOG_NO_INFO
can be set by users with-DLOG_NO_INFO
, which defaults to OFF in debug and ON in every other configuration.FASTDDS_ENFORCE_LOG_INFO
can be defined by the user and defaults to OFF__INTERNALDEBUG
is defined when compiling Fast DDS with-DINTERNAL_DEBUG
, which defaults to OFF_INTERNALDEBUG
can be defined by the user. Fast DDS does not define it, nor Fast DDS CMakeLists_DEBUG
is defined when using Windows config generators in build type is debug__DEBUG
is defined iffCMAKE_BUILD_TYPE
is set to exactlyDebug
(other casing will not match)This means that a Linux user building in debug with
CMAKE_BUILD_TYPE=DEBUG
(or something other than Debug) and with-DINTERNAL_DEBUG
can end up with no log infos. This PR adds an additional check for case 3, which is check for either_DEBUG
,__DEBUG
or thatNDEBUG
is not defined.NDEBUG
is actually a C++ standard definition that must be set when building is something other than debug. CMake adds this definition by itself, so no CMakeLists.txt needs to be modified.Signed-off-by: Eduardo Ponz Segrelles eduardoponz@eprosima.com