From: Torsten Dreyer Date: Mon, 17 Mar 2014 15:38:53 +0000 (+0100) Subject: httpd: don't spam the console with debug messages X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=efcc89480db17c181262aca1d6001ba9d92f0867;p=flightgear.git httpd: don't spam the console with debug messages --- diff --git a/src/Network/http/JsonUriHandler.cxx b/src/Network/http/JsonUriHandler.cxx index 6253a9920..c4ca455b6 100644 --- a/src/Network/http/JsonUriHandler.cxx +++ b/src/Network/http/JsonUriHandler.cxx @@ -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; } diff --git a/src/Network/http/PropertyChangeWebsocket.cxx b/src/Network/http/PropertyChangeWebsocket.cxx index bfe5841b6..afa259951 100644 --- a/src/Network/http/PropertyChangeWebsocket.cxx +++ b/src/Network/http/PropertyChangeWebsocket.cxx @@ -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)"); } } } diff --git a/src/Network/http/PropertyUriHandler.cxx b/src/Network/http/PropertyUriHandler.cxx index 6d57d0174..edbc0f676 100644 --- a/src/Network/http/PropertyUriHandler.cxx +++ b/src/Network/http/PropertyUriHandler.cxx @@ -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" ); diff --git a/src/Network/http/RunUriHandler.cxx b/src/Network/http/RunUriHandler.cxx index 5f1a2aece..d682e65b7 100644 --- a/src/Network/http/RunUriHandler.cxx +++ b/src/Network/http/RunUriHandler.cxx @@ -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; } diff --git a/src/Network/http/httpd.cxx b/src/Network/http/httpd.cxx index 5733768a1..be58dc31f 100644 --- a/src/Network/http/httpd.cxx +++ b/src/Network/http/httpd.cxx @@ -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(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 {