Setting the logging level at compile time requires code modification, which is not recommended for most cases; however, it removes the overhead of all the logging functions below a given level. Also, ROS provides ROSCONSOLE_MIN_SEVERITY as a macro variable, which must be set to the minimum desired severity level. These macros are as follows:
For example, if the desired logging level is an ERROR or higher message, we should define this in the source code as follows:
#define ROSCONSOLE_MIN_SEVERITY ROSCONSOLE_SEVERITY_ERROR
On the other hand, ROSCONSOLE_MIN_SEVERITY could be ...