gabyx / ApproxMVBB

Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in 3D.
Mozilla Public License 2.0
441 stars 93 forks source link

There is no way to completely disable logs in debug compilations #46

Closed alexcarruesco closed 3 years ago

alexcarruesco commented 3 years ago

Hi, I found that the library provides a compilation definition to force a specific log level using the macro ApproxMVBB_FORCE_MSGLOG_LEVEL. However, the way it is handled in LogDefines.h line 27 (https://github.com/gabyx/ApproxMVBB/blob/master/include/ApproxMVBB/Common/LogDefines.hpp#L27) makes it impossible to set a log level of 0 (i.e. no log messages), because only log levels greater than 0 are forced. For log level 0, the #else applies, and the log level is set to 0 or 2 depending on the NDEBUG definition. However, I would like to disable always log messages, and we could easily do that by just applying a minor change in the LogDefines.h, which would be replacing the line 27:

if ApproxMVBB_FORCE_MSGLOG_LEVEL > 0

by

if ApproxMVBB_FORCE_MSGLOG_LEVEL >= 0

What do you think? Could you apply this change? Thanks in advance!

gabyx commented 3 years ago

Good point! I change that immediatly.

gabyx commented 3 years ago

Check current master, and see if it works. -> The cmake cache is now set to ApproxMVBB_FORCE_MSGLOG_LEVEL=-1

alexcarruesco commented 3 years ago

Thanks for the fast response! I already validated the change in the library in my project, so everything is working as expected now 👍

Have a great day!