Ensure route table thread logging can be disabled 98/2398/1
authorE. Scott Daniels <daniels@research.att.com>
Fri, 31 Jan 2020 21:10:34 +0000 (16:10 -0500)
committerE. Scott Daniels <daniels@research.att.com>
Fri, 31 Jan 2020 21:10:34 +0000 (16:10 -0500)
The messages written by the route table collector thread are
not affected by the verbose level that the user application
can set. This change allows the complete squelching of the
messages from this thread when all messages are turned off.

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Change-Id: Iddea13591f28a96f0cfc4630924a9fc11fadd809

CHANGES
CMakeLists.txt
src/rmr/common/src/logging.c

diff --git a/CHANGES b/CHANGES
index cd88f3e..d40e1fc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 API and build change  and fix summaries. Doc correctsions
 and/or changes are not mentioned here; see the commit messages.
 
+2020 January 31; verison 3.1.1
+       Allow route table thread logging to be completely disabled
+       when logging is turned off.     
+
 2020 January 26; verison 3.1.0
        First step to allowing the user programme to control messages
        written to standard error. Introduces the rmr_set_vlevel()
index 9a51535..a93ce69 100644 (file)
@@ -38,7 +38,7 @@ cmake_minimum_required( VERSION 3.5 )
 
 set( major_version "3" )               # should be automatically populated from git tag later, but until CI process sets a tag we use this
 set( minor_version "1" )
-set( patch_level "0" )
+set( patch_level "1" )
 
 set( install_root "${CMAKE_INSTALL_PREFIX}" )
 set( install_inc "include/rmr" )
index 0105391..ce6c246 100644 (file)
@@ -171,6 +171,10 @@ extern void rmr_vlog_force( int write_level, char* fmt, ... ) {
                rmr_vlog_init();
        }
 
+       if( log_vlevel <= 0 ) {                 // cant force if off completely to allow for total silience
+               return;
+       }
+
        if( write_level > RMR_VL_DEBUG || write_level < 0 ) {
                write_level = RMR_VL_DEBUG;
        }