LP#1284137: Avoid WARN logging on router shutdown
authorBill Erickson <berick@esilibrary.com>
Mon, 24 Feb 2014 14:09:46 +0000 (09:09 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 27 Feb 2014 22:38:15 +0000 (14:38 -0800)
Log received signals as DEBUG (misc signal) or INFO (during shutdown)
in the router, since these are not error conditions, but normal
operations.

A warning may ultimately be logged at a higher level when the signal is
unexpected.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
src/router/osrf_router.c
src/router/osrf_router_main.c

index 359d98a..528dfa2 100644 (file)
@@ -220,7 +220,7 @@ void osrfRouterRun( osrfRouter* router ) {
                if( (selectret = select(maxfd + 1, &set, NULL, NULL, NULL)) < 0 ) {
                        if( EINTR == errno ) {
                                if( router->stop ) {
-                                       osrfLogWarning( OSRF_LOG_MARK, "Top level select call interrupted by signal" );
+                                       osrfLogInfo(OSRF_LOG_MARK, "Router shutting down");
                                        break;
                                }
                                else
index ba14551..202e99a 100644 (file)
@@ -154,8 +154,8 @@ int main( int argc, char* argv[] ) {
 
        if( stop_signal ) {
                // Interrupted by a signal?  Re-raise so the parent can see it.
-               osrfLogWarning( OSRF_LOG_MARK, "Interrupted by signal %d; re-raising",
-                               (int) stop_signal );
+               osrfLogDebug(OSRF_LOG_MARK,
+                       "Router received signal %d; re-raising", (int) stop_signal);
                signal( stop_signal, SIG_DFL );
                raise( stop_signal );
        }