Allow user programme to set RMR verbosity level
[ric-plt/lib/rmr.git] / src / rmr / si / src / rtc_si_static.c
index 193672f..dbccd58 100644 (file)
@@ -60,7 +60,7 @@ static void* rtc_file( void* vctx ) {
 
 
        if( (ctx = (uta_ctx_t *) vctx) == NULL ) {
-               fprintf( stderr, "[CRI] rmr_rtc: internal mishap: context passed in was nil\n" );
+               rmr_vlog( RMR_VL_CRIT, "rmr_rtc: internal mishap: context passed in was nil\n" );
                return NULL;
        }
 
@@ -167,7 +167,7 @@ static void* rtc( void* vctx ) {
 
 
        if( (ctx = (uta_ctx_t *) vctx) == NULL ) {
-               fprintf( stderr, "[CRI] rmr_rtc: internal mishap: context passed in was nil\n" );
+               rmr_vlog( RMR_VL_CRIT, "rmr_rtc: internal mishap: context passed in was nil\n" );
                return NULL;
        }
 
@@ -206,7 +206,7 @@ static void* rtc( void* vctx ) {
        }
 
        if( (pvt_cx = init( port, MAX_RTG_MSG_SZ, FL_NOTHREAD )) == NULL ) {                            // open a private context (no RT listener!)
-               fprintf( stderr, "[CRI] rmr_rtc: unable to initialise listen port for RTG (pvt_cx)\n" );
+               rmr_vlog( RMR_VL_CRIT, "rmr_rtc: unable to initialise listen port for RTG (pvt_cx)\n" );
 
                while( TRUE ) {                                                                                         // no listen port, just dump counts now and then
                        sleep( count_delay );
@@ -217,7 +217,7 @@ static void* rtc( void* vctx ) {
                return NULL;
        }
 
-       if( DEBUG ) fprintf( stderr, "[DBUG] rtc thread is running and listening; listening for rtg conns on %s\n", port );
+       if( DEBUG ) rmr_vlog( RMR_VL_DEBUG, "rtc thread is running and listening; listening for rtg conns on %s\n", port );
        free( fport );
 
        // future:  if we need to register with the rtg, then build a message and send it through a wormhole here
@@ -246,9 +246,9 @@ static void* rtc( void* vctx ) {
                        payload = msg->payload;
                        mlen = msg->len;                                        // usable bytes in the payload
                        if( vlevel > 1 ) {
-                               fprintf( stderr, "[DBUG] rmr_rtc: received rt message; %d bytes (%s)\n", (int) mlen, msg->payload );
+                               rmr_vlog( RMR_VL_DEBUG, "rmr_rtc: received rt message; %d bytes (%s)\n", (int) mlen, msg->payload );
                        } else {
-                               if( DEBUG > 1 || (vlevel > 0) ) fprintf( stderr, "[DBUG] rmr_rtc: received rt message; %d bytes\n", (int) mlen );
+                               if( DEBUG > 1 || (vlevel > 0) ) rmr_vlog( RMR_VL_DEBUG, "rmr_rtc: received rt message; %d bytes\n", (int) mlen );
                        }
 
                        if( pbuf_size <= mlen ) {
@@ -274,7 +274,7 @@ static void* rtc( void* vctx ) {
                                }
 
                                if( vlevel > 1 ) {
-                                       fprintf( stderr, "[DBUG] rmr_rtc: processing (%s)\n", curr );
+                                       rmr_vlog( RMR_VL_DEBUG, "rmr_rtc: processing (%s)\n", curr );
                                }
                                parse_rt_rec( ctx, curr, vlevel );              // parse record and add to in progress table