]> git.mxchange.org Git - flightgear.git/commitdiff
httpd: don't spam the console with debug messages
authorTorsten Dreyer <torsten@t3r.de>
Mon, 17 Mar 2014 15:38:53 +0000 (16:38 +0100)
committerTorsten Dreyer <torsten@t3r.de>
Mon, 17 Mar 2014 15:38:53 +0000 (16:38 +0100)
src/Network/http/JsonUriHandler.cxx
src/Network/http/PropertyChangeWebsocket.cxx
src/Network/http/PropertyUriHandler.cxx
src/Network/http/RunUriHandler.cxx
src/Network/http/httpd.cxx

index 6253a99203afccc33643552eed0e0dba706a209a..c4ca455b642f8cf94cbb1985a04027e571f4e3d9 100644 (file)
@@ -59,7 +59,7 @@ bool JsonUriHandler::handleGetRequest( const HTTPRequest & request, HTTPResponse
   if( false == node.valid() ) {
     response.StatusCode = 400;
     response.Content = "Node not found: " + propertyPath;
-    SG_LOG(SG_NETWORK,SG_ALERT, response.Content );
+    SG_LOG(SG_NETWORK,SG_WARN, "Node not found: '" << response.Content << "'");
     return true;
 
   } 
index bfe5841b6f09d1090fff58a6f78e400d7cacd724..afa25995131b358c87c656390c93ee225d800817 100644 (file)
@@ -43,7 +43,7 @@ PropertyChangeWebsocket::~PropertyChangeWebsocket()
 
 void PropertyChangeWebsocket::close()
 {
-  SG_LOG(SG_NETWORK, SG_ALERT, "closing PropertyChangeWebsocket #" << id);
+  SG_LOG(SG_NETWORK, SG_INFO, "closing PropertyChangeWebsocket #" << id);
   _watchedNodes.clear();
 }
 
@@ -96,7 +96,7 @@ void PropertyChangeWebsocket::update(WebsocketWriter & writer)
 
     string newValue;
     if (_propertyChangeObserver->isChangedValue(node)) {
-      SG_LOG(SG_NETWORK, SG_ALERT, "httpd: new Value for " << node->getPath(true) << " '" << node->getStringValue() << "' #" << id);
+      SG_LOG(SG_NETWORK, SG_DEBUG, "httpd: new Value for " << node->getPath(true) << " '" << node->getStringValue() << "' #" << id);
       writer.writeText( JSON::toJsonString( false, node, 0 ) );
     }
   }
@@ -108,22 +108,20 @@ void PropertyChangeWebsocket::WatchedNodesList::handleCommand(const string & com
   if (command == "addListener") {
     for (iterator it = begin(); it != end(); ++it) {
       if (node == (*it)->getPath(true)) {
-        SG_LOG(SG_NETWORK, SG_ALERT, "httpd: " << command << " '" << node << "' ignored (duplicate)");
+        SG_LOG(SG_NETWORK, SG_WARN, "httpd: " << command << " '" << node << "' ignored (duplicate)");
         return; // dupliate
       }
     }
     SGPropertyNode_ptr n = propertyChangeObserver->addObservation(node);
     if (n.valid()) push_back(n);
-    SG_LOG(SG_NETWORK, SG_ALERT, "httpd: " << command << " '" << node << "'");
 
   } else if (command == "removeListener") {
     for (iterator it = begin(); it != end(); ++it) {
       if (node == (*it)->getPath(true)) {
         this->erase(it);
-        SG_LOG(SG_NETWORK, SG_ALERT, "httpd: " << command << " '" << node << "'");
         return;
       }
-      SG_LOG(SG_NETWORK, SG_ALERT, "httpd: " << command << " '" << node << "' ignored (not found)");
+      SG_LOG(SG_NETWORK, SG_WARN, "httpd: " << command << " '" << node << "' ignored (not found)");
     }
   }
 }
index 6d57d01745137f103e5461d1f4c1bec4c98fbfb9..edbc0f676006a2dcf5c021af1a170777c40eb728 100644 (file)
@@ -244,7 +244,7 @@ bool PropertyUriHandler::handleGetRequest( const HTTPRequest & request, HTTPResp
       fgSetString( propertyPath.c_str(), value );
     }
     catch( string & s ) { 
-      SG_LOG(SG_NETWORK,SG_ALERT, "httpd: setting " << propertyPath << " to '" << value << "' failed: " << s );
+      SG_LOG(SG_NETWORK,SG_WARN, "httpd: setting " << propertyPath << " to '" << value << "' failed: " << s );
     }
   }
 
@@ -257,7 +257,7 @@ bool PropertyUriHandler::handleGetRequest( const HTTPRequest & request, HTTPResp
         fgSetString( pp, it->second );
       }
       catch( string & s ) { 
-        SG_LOG(SG_NETWORK,SG_ALERT, "httpd: setting " << pp << " to '" << it->second << "' failed: " << s );
+        SG_LOG(SG_NETWORK,SG_WARN, "httpd: setting " << pp << " to '" << it->second << "' failed: " << s );
       }
     }
   }
@@ -288,7 +288,7 @@ bool PropertyUriHandler::handleGetRequest( const HTTPRequest & request, HTTPResp
     node = fgGetNode( string("/") + propertyPath );
   }
   catch( string & s ) { 
-    SG_LOG(SG_NETWORK,SG_ALERT, "httpd: reading '" << propertyPath  << "' failed: " << s );
+    SG_LOG(SG_NETWORK,SG_WARN, "httpd: reading '" << propertyPath  << "' failed: " << s );
   }
   if( false == node.valid() ) {
     DOMNode * headline = new DOMNode( "h3" );
index 5f1a2aece33032b64cc3b2c47a28338f0b4bb420..d682e65b7ce9fa6a8a24072016930c981ffb9c3f 100644 (file)
@@ -54,7 +54,7 @@ bool RunUriHandler::handleRequest( const HTTPRequest & request, HTTPResponse & r
   } 
 
   response.Content = "command '" + command + "' failed.";
-  SG_LOG( SG_NETWORK, SG_ALERT, response.Content );
+  SG_LOG( SG_NETWORK, SG_WARN, response.Content );
   return true;
 }
 
index 5733768a1555186fc8bee247e95c70f490380f8f..be58dc31f175c5ed03de1319e0aaf7525f493b35 100644 (file)
@@ -141,7 +141,6 @@ void MongooseHttpd::init()
           rewrites.append( fgRoot ).append( 1, '/' ).append( rhs );
         }
       }
-      SG_LOG(SG_NETWORK,SG_ALERT,"url-rewrites='" << rewrites << "'" );
       if( false == rewrites.empty() )
         mg_set_option(_server, "url_rewrites", rewrites.c_str() );
     }
@@ -266,7 +265,7 @@ int MongooseHttpd::websocketHandler(struct mg_connection * connection)
   Websocket * websocket = static_cast<Websocket*>(connection->connection_param);
   if ( NULL == websocket) {
     if (request.Uri.find("/PropertyListener") == 0) {
-      SG_LOG(SG_ALL, SG_ALERT, "new PropertyChangeWebsocket for: " << request.Uri);
+      SG_LOG(SG_ALL, SG_INFO, "new PropertyChangeWebsocket for: " << request.Uri);
       websocket = new PropertyChangeWebsocket(&_propertyChangeObserver);
       connection->connection_param = websocket;
     } else {