]> git.mxchange.org Git - flightgear.git/commitdiff
Add --log-class option, improve logging classes.
authorThorstenB <brehmt@gmail.com>
Sun, 11 Dec 2011 12:55:56 +0000 (13:55 +0100)
committerThorstenB <brehmt@gmail.com>
Sun, 11 Dec 2011 13:06:17 +0000 (14:06 +0100)
Replace SG_GENERAL by more specific log classes in many places.
Allow "," to separate logging classes (using "|" is odd on the
command-line).
Also add new option to make logging more useful for developers.
You can use:
  --log-level=debug --log-class=environment
to only get environment debug messages, or
  --log-level=debug --log-class=sound,ai
to only get debug messages related to the sound or AI subsystem.

32 files changed:
src/AIModel/AIFlightPlan.cxx
src/AIModel/AIFlightPlanCreate.cxx
src/AIModel/AIFlightPlanCreatePushBack.cxx
src/AIModel/AIManager.cxx
src/AIModel/AIManager.hxx
src/AIModel/performancedb.cxx
src/AIModel/submodel.cxx
src/ATC/atc_mgr.cxx
src/ATC/trafficcontrol.cxx
src/ATCDCL/ATC.cxx
src/ATCDCL/ATCmgr.cxx
src/Cockpit/panel.cxx
src/FDM/YASim/Rotor.cpp
src/FDM/YASim/YASim.cxx
src/Input/fgjs.cxx
src/Instrumentation/adf.cxx
src/Instrumentation/dclgps.cxx
src/Instrumentation/mrg.cxx
src/Instrumentation/od_gauge.cxx
src/Instrumentation/rnav_waypt_controller.cxx
src/Instrumentation/wxradar.cxx
src/Main/fg_props.cxx
src/Main/fg_props.hxx
src/Main/options.cxx
src/Model/acmodel.cxx
src/Model/modelmgr.cxx
src/Network/ATC-Main.cxx
src/Network/generic.cxx
src/Network/httpd.cxx
src/Network/props.cxx
src/Scripting/NasalSys.cxx
src/Scripting/nasal-props.cxx

index 0f99e7a9ef5b6287c966d4ea1f26e19232fcef69..09d1eb746548aab78c99373fb443caa093da37f2 100644 (file)
@@ -101,7 +101,7 @@ FGAIFlightPlan::FGAIFlightPlan(const string& filename)
   try {
       readProperties(path.str(), &root);
   } catch (const sg_exception &) {
-      SG_LOG(SG_GENERAL, SG_ALERT,
+      SG_LOG(SG_AI, SG_ALERT,
        "Error reading AI flight plan: " << path.str());
        // cout << path.str() << endl;
      return;
@@ -212,7 +212,7 @@ FGAIFlightPlan::FGAIFlightPlan(FGAIAircraft *ac,
          } // of node loop
           wpt_iterator = waypoints.begin();
        } catch (const sg_exception &e) {
-      SG_LOG(SG_GENERAL, SG_WARN, "Error reading AI flight plan: " << 
+      SG_LOG(SG_AI, SG_WARN, "Error reading AI flight plan: " <<
         e.getMessage() << " from " << e.getOrigin());
     }
   } else {
@@ -237,7 +237,7 @@ FGAIFlightPlan::FGAIFlightPlan(FGAIAircraft *ac,
       if (timeDiff >= 2000)
           leg = 5;
       */
-      SG_LOG(SG_GENERAL, SG_INFO, "Route from " << dep->getId() << " to " << arr->getId() << ". Set leg to : " << leg << " " << ac->getTrafficRef()->getCallSign());
+      SG_LOG(SG_AI, SG_INFO, "Route from " << dep->getId() << " to " << arr->getId() << ". Set leg to : " << leg << " " << ac->getTrafficRef()->getCallSign());
       wpt_iterator = waypoints.begin();
       bool dist = 0;
       isValid = create(ac, dep,arr, leg, alt, speed, lat, lon,
index 8375c854e7340b8bd1bdc25b22670042133de6c9..b603173de38f1415edfd3bd62a194eed7a1a003c 100644 (file)
@@ -98,7 +98,7 @@ bool FGAIFlightPlan::create(FGAIAircraft * ac, FGAirport * dep,
         break;
     default:
         //exit(1);
-        SG_LOG(SG_INPUT, SG_ALERT,
+        SG_LOG(SG_AI, SG_ALERT,
                "AIFlightPlan::create() attempting to create unknown leg"
                " this is probably an internal program error");
     }
@@ -215,7 +215,7 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
                                                       &heading, &gateId,
                                                       radius, fltType,
                                                       acType, airline))) {
-            SG_LOG(SG_INPUT, SG_WARN, "Could not find parking for a " <<
+            SG_LOG(SG_AI, SG_WARN, "Could not find parking for a " <<
                    acType <<
                    " of flight type " << fltType <<
                    " of airline     " << airline <<
index d5c79356ee1728892d007a5401ecc8319ed3cc48..b65333dd746b898e6d693c71d80ad1920700a8c5 100644 (file)
@@ -66,7 +66,7 @@ bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
                     &heading, &gateId,
                     radius, fltType,
                     aircraftType, airline))) {
-                SG_LOG(SG_INPUT, SG_WARN, "Warning: Could not find parking for a " <<
+                SG_LOG(SG_AI, SG_WARN, "Warning: Could not find parking for a " <<
                        aircraftType <<
                        " of flight type " << fltType <<
                        " of airline     " << airline <<
@@ -81,7 +81,7 @@ bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
                 pushBackWaypoint(wpt);
             }
             //cerr << "Success : GateId = " << gateId << endl;
-            SG_LOG(SG_INPUT, SG_WARN, "Warning: Succesfully found a parking for a " <<
+            SG_LOG(SG_AI, SG_WARN, "Warning: Succesfully found a parking for a " <<
                    aircraftType <<
                    " of flight type " << fltType <<
                    " of airline     " << airline <<
@@ -118,8 +118,8 @@ bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
             pushBackRoute = parking->getPushBackRoute();
             int size = pushBackRoute->size();
             if (size < 2) {
-                SG_LOG(SG_GENERAL, SG_WARN, "Push back route from gate " << gateId << " has only " << size << " nodes.");
-                SG_LOG(SG_GENERAL, SG_WARN, "Using  " << pushBackNode);
+                SG_LOG(SG_AI, SG_WARN, "Push back route from gate " << gateId << " has only " << size << " nodes.");
+                SG_LOG(SG_AI, SG_WARN, "Using  " << pushBackNode);
             }
             pushBackRoute->first();
             while (pushBackRoute->next(&node, &rte))
@@ -151,14 +151,14 @@ bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
             // if the starting node equals the ending node, then there aren't any routes for this parking.
             // in cases like these we should flag the gate as being inoperative and return false
             if (ts == te) {
-                SG_LOG(SG_GENERAL, SG_ALERT, "Gate " << gateId << "doesn't seem to have routes associated with it.");
+                SG_LOG(SG_AI, SG_ALERT, "Gate " << gateId << "doesn't seem to have routes associated with it.");
                 parking->setAvailable(false);
                 return false;
             }
             tn = (*ts)->getEnd();
             lastNodeVisited = tn->getIndex();
             if (tn == NULL) {
-                SG_LOG(SG_GENERAL, SG_ALERT, "No valid taxinode found");
+                SG_LOG(SG_AI, SG_ALERT, "No valid taxinode found");
                 exit(1);
             }
             double distance = (*ts)->getLength();
index 731983f25dc710c4ced8042edbc7e1ebf4b85f13..d2232fc8498fe8567a4d6f56f40674be55426f25 100644 (file)
@@ -103,11 +103,11 @@ FGAIManager::postinit() {
             continue;
 
         if (scenarios.find(name) != scenarios.end()) {
-            SG_LOG(SG_GENERAL, SG_DEBUG, "won't load scenario '" << name << "' twice");
+            SG_LOG(SG_AI, SG_DEBUG, "won't load scenario '" << name << "' twice");
             continue;
         }
 
-        SG_LOG(SG_GENERAL, SG_ALERT, "loading scenario '" << name << '\'');
+        SG_LOG(SG_AI, SG_ALERT, "loading scenario '" << name << '\'');
         processScenario(name);
         scenarios[name] = true;
     }
@@ -376,7 +376,7 @@ FGAIManager::loadScenarioFile(const std::string& filename)
         readProperties(path.str(), root);
         return root;
     } catch (const sg_exception &t) {
-        SG_LOG(SG_GENERAL, SG_ALERT, "Failed to load scenario '"
+        SG_LOG(SG_AI, SG_ALERT, "Failed to load scenario '"
             << path.str() << "': " << t.getFormattedMessage());
         return 0;
     }
@@ -437,7 +437,7 @@ FGAIManager::calcCollision(double alt, double lat, double lon, double fuse_range
 
         if (fabs(tgt_alt - alt) > tgt_ht[type] || type == FGAIBase::otBallistic
             || type == FGAIBase::otStorm || type == FGAIBase::otThermal ) {
-                //SG_LOG(SG_GENERAL, SG_DEBUG, "AIManager: skipping "
+                //SG_LOG(SG_AI, SG_DEBUG, "AIManager: skipping "
                 //    << fabs(tgt_alt - alt)
                 //    << " "
                 //    << type
@@ -452,7 +452,7 @@ FGAIManager::calcCollision(double alt, double lat, double lon, double fuse_range
 
         double range = calcRange(lat, lon, tgt_lat, tgt_lon);
 
-        //SG_LOG(SG_GENERAL, SG_DEBUG, "AIManager:  AI list size "
+        //SG_LOG(SG_AI, SG_DEBUG, "AIManager:  AI list size "
         //    << ai_list.size()
         //    << " type " << type
         //    << " ID " << id
@@ -464,7 +464,7 @@ FGAIManager::calcCollision(double alt, double lat, double lon, double fuse_range
         tgt_length[type] += fuse_range;
 
         if (range < tgt_length[type]){
-            SG_LOG(SG_GENERAL, SG_DEBUG, "AIManager: HIT! "
+            SG_LOG(SG_AI, SG_DEBUG, "AIManager: HIT! "
                 << " type " << type
                 << " ID " << id
                 << " range " << range
index 5c951912e645e824a4395428c45bec5512cb6cc5..fad76a63d032f3b09c0940a9a1870aa7cbaf8f40 100644 (file)
@@ -54,7 +54,7 @@ public:
     ai_list_type ai_list;
 
     inline const ai_list_type& get_ai_list() const {
-        SG_LOG(SG_GENERAL, SG_DEBUG, "AI Manager: AI model return list size " << ai_list.size());
+        SG_LOG(SG_AI, SG_DEBUG, "AI Manager: AI model return list size " << ai_list.size());
         return ai_list;
     }
 
index f7c286a9a345b8aea1d73ff6d5b9160f151a89b6..842cb9bf83aee16c14d409a7522057e5964c0a56 100644 (file)
@@ -62,7 +62,7 @@ void PerformanceDB::load(SGPath filename) {
     try {
         readProperties(filename.str(), &root);
     } catch (const sg_exception &) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_AI, SG_ALERT,
             "Error reading AI aircraft performance database: " << filename.str());
         return;
     }
index 83bb681b071665aaac8f6e908e6b8122714fa278..e4746bfc8d3cc37bd65d319b81d2b7e2595b9249 100644 (file)
@@ -136,19 +136,19 @@ void FGSubmodelMgr::update(double dt)
         if ( parent_subID == 0 || id == -1) // this entry in the list has no associated submodel
             continue;                       // or is invalid so we can continue
 
-        //SG_LOG(SG_GENERAL, SG_DEBUG, "Submodel: Impact " << _impact << " hit! "
+        //SG_LOG(SG_AI, SG_DEBUG, "Submodel: Impact " << _impact << " hit! "
         //        << _hit <<" parent_subID " << parent_subID);
 
         _hit = (*sm_list_itr)->_getCollisionData();
         _impact = (*sm_list_itr)->_getImpactData();
         _expiry = (*sm_list_itr)->_getExpiryData();
 
-        //SG_LOG(SG_GENERAL, SG_ALERT, "Submodel: " << (*sm_list_itr)->_getName()
+        //SG_LOG(SG_AI, SG_ALERT, "Submodel: " << (*sm_list_itr)->_getName()
         //    << " Impact " << _impact << " hit! " << _hit
         //    << " exipiry :-( " << _expiry );
 
         if (_impact || _hit || _expiry) {
-    //        SG_LOG(SG_GENERAL, SG_ALERT, "Submodel: Impact " << _impact << " hit! " << _hit 
+    //        SG_LOG(SG_AI, SG_ALERT, "Submodel: Impact " << _impact << " hit! " << _hit
                 //<< " exipiry :-( " << _expiry );
 
             submodel_iterator = submodels.begin();
@@ -191,7 +191,7 @@ void FGSubmodelMgr::update(double dt)
     while (submodel_iterator != submodels.end())  {
         i++;
 
-        /*SG_LOG(SG_GENERAL, SG_DEBUG,
+        /*SG_LOG(SG_AI, SG_DEBUG,
                 "Submodels:  " << (*submodel_iterator)->id
                 << " name " << (*submodel_iterator)->name
                 );*/
@@ -210,7 +210,7 @@ void FGSubmodelMgr::update(double dt)
             //int id = (*submodel_iterator)->id;
             string name = (*submodel_iterator)->name;
             
-            SG_LOG(SG_GENERAL, SG_DEBUG,
+            SG_LOG(SG_AI, SG_DEBUG,
             "Submodels release:  " << (*submodel_iterator)->id
             << " name " << (*submodel_iterator)->name
             << " count " << (*submodel_iterator)->count
@@ -477,12 +477,12 @@ void FGSubmodelMgr::updatelat(double lat)
 
 void FGSubmodelMgr::loadAI()
 {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "Submodels: Loading AI submodels ");
+    SG_LOG(SG_AI, SG_DEBUG, "Submodels: Loading AI submodels ");
 
     FGAIManager::ai_list_type sm_list(aiManager()->get_ai_list());
 
     if (sm_list.empty()) {
-        SG_LOG(SG_GENERAL, SG_ALERT, "Submodels: Unable to read AI submodel list");
+        SG_LOG(SG_AI, SG_ALERT, "Submodels: Unable to read AI submodel list");
         return;
     }
 
@@ -516,11 +516,11 @@ void FGSubmodelMgr::setData(int id, string& path, bool serviceable)
 
     SGPath config = globals->resolve_aircraft_path(path);
     try {
-        SG_LOG(SG_GENERAL, SG_DEBUG,
+        SG_LOG(SG_AI, SG_DEBUG,
                 "Submodels: Trying to read AI submodels file: " << config.str());
         readProperties(config.str(), &root);
     } catch (const sg_exception &) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_AI, SG_ALERT,
                 "Submodels: Unable to read AI submodels file: " << config.str());
         return;
     }
@@ -620,12 +620,12 @@ void FGSubmodelMgr::setSubData(int id, string& path, bool serviceable)
     SGPath config = globals->resolve_aircraft_path(path);
 
     try {
-        SG_LOG(SG_GENERAL, SG_DEBUG,
+        SG_LOG(SG_AI, SG_DEBUG,
                 "Submodels: Trying to read AI submodels file: " << config.str());
         readProperties(config.str(), &root);
 
     } catch (const sg_exception &) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_AI, SG_ALERT,
                 "Submodels: Unable to read AI submodels file: " << config.str());
         return;
     }
@@ -722,7 +722,7 @@ void FGSubmodelMgr::setSubData(int id, string& path, bool serviceable)
 
 void FGSubmodelMgr::loadSubmodels()
 {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "Submodels: Loading sub submodels");
+    SG_LOG(SG_AI, SG_DEBUG, "Submodels: Loading sub submodels");
 
     _found_sub = false;
 
@@ -733,7 +733,7 @@ void FGSubmodelMgr::loadSubmodels()
         if (!submodel.empty()) {
             //int id = (*submodel_iterator)->id;
             bool serviceable = true;
-            SG_LOG(SG_GENERAL, SG_DEBUG, "found path sub sub "
+            SG_LOG(SG_AI, SG_DEBUG, "found path sub sub "
                     << submodel
                     << " index " << index
                     << " name " << (*submodel_iterator)->name);
@@ -766,7 +766,7 @@ void FGSubmodelMgr::loadSubmodels()
     //    int id = (*submodel_iterator)->id;
     //    subcount++;
 
-    //    SG_LOG(SG_GENERAL, SG_ALERT,"after pushback "
+    //    SG_LOG(SG_AI, SG_ALERT,"after pushback "
     //            << " parent id " << id
     //            << " name " << (*submodel_iterator)->name
     //            << " sub id " << (*submodel_iterator)->sub_id
@@ -898,7 +898,7 @@ void FGSubmodelMgr::setParentNode(int id) {
         //cout << name << " IC.speed " << IC.speed << endl;
 
     } else {
-        SG_LOG(SG_GENERAL, SG_ALERT, "AISubmodel: parent node not found ");
+        SG_LOG(SG_AI, SG_ALERT, "AISubmodel: parent node not found ");
     }
 
 }
index 0fbec13134a55f4b9508b62988dc6e706b74e4eb..ea81f390f0d528eb0f6ce4de9f67d29babf32b48 100644 (file)
@@ -107,7 +107,7 @@ void FGATCManager::init() {
         fp = new FGAIFlightPlan;
         while (park_index >= 0 && dcs->getParkingName(park_index) != parking) park_index--;
             if (park_index < 0) {
-                  SG_LOG( SG_GENERAL, SG_ALERT,
+                  SG_LOG( SG_ATC, SG_ALERT,
                         "Failed to find parking position " << parking <<
                         " at airport " << airport << " at " << SG_ORIGIN);
             }
index e42def60d328cb3d11f1cf31a6ab84d8e29d877e..ee0f06a7fc6be64eb9957d33e534e208e5800595 100644 (file)
@@ -186,7 +186,7 @@ void FGTrafficRecord::setPositionAndIntentions(int pos,
     if (intentions.size()) {
         intVecIterator i = intentions.begin();
         if ((*i) != pos) {
-            SG_LOG(SG_GENERAL, SG_ALERT,
+            SG_LOG(SG_ATC, SG_ALERT,
                    "Error in FGTrafficRecord::setPositionAndIntentions at " << SG_ORIGIN);
             cerr << "Pos : " << pos << " Curr " << *(intentions.begin())  << endl;
             for (intVecIterator i = intentions.begin();
@@ -894,7 +894,7 @@ void FGTowerController::updateAircraftInformation(int id, double lat, double lon
     }
 //    // update position of the current aircraft
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: updating aircraft without traffic record at " << SG_ORIGIN);
     } else {
         i->setPositionAndHeading(lat, lon, heading, speed, alt);
@@ -989,12 +989,12 @@ void FGTowerController::signOff(int id)
             rwy->setCleared(0);
             rwy->updateDepartureCue();
         } else {
-            SG_LOG(SG_GENERAL, SG_ALERT,
+            SG_LOG(SG_ATC, SG_ALERT,
                    "AI error: Attempting to erase non-existing runway clearance record in FGTowerController::signoff at " << SG_ORIGIN);
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: Aircraft without traffic record is signing off from tower at " << SG_ORIGIN);
     } else {
         i->getAircraft()->resetTakeOffStatus();
@@ -1024,7 +1024,7 @@ bool FGTowerController::hasInstruction(int id)
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: checking ATC instruction for aircraft without traffic record at " << SG_ORIGIN);
     } else {
         return i->hasInstruction();
@@ -1048,7 +1048,7 @@ FGATCInstruction FGTowerController::getInstruction(int id)
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: requesting ATC instruction for aircraft without traffic record at " << SG_ORIGIN);
     } else {
         return i->getInstruction();
@@ -1143,7 +1143,7 @@ bool FGStartupController::hasInstruction(int id)
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: checking ATC instruction for aircraft without traffic record at " << SG_ORIGIN);
     } else {
         return i->hasInstruction();
@@ -1167,7 +1167,7 @@ FGATCInstruction FGStartupController::getInstruction(int id)
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: requesting ATC instruction for aircraft without traffic record at " << SG_ORIGIN);
     } else {
         return i->getInstruction();
@@ -1190,7 +1190,7 @@ void FGStartupController::signOff(int id)
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: Aircraft without traffic record is signing off from tower at " << SG_ORIGIN);
     } else {
         //cerr << i->getAircraft()->getCallSign() << " signing off from startupcontroller" << endl;
@@ -1251,7 +1251,7 @@ void FGStartupController::updateAircraftInformation(int id, double lat, double l
 //    // update position of the current aircraft
 
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: updating aircraft without traffic record at " << SG_ORIGIN);
     } else {
         i->setPositionAndHeading(lat, lon, heading, speed, alt);
@@ -1594,7 +1594,7 @@ void FGApproachController::updateAircraftInformation(int id, double lat, double
     }
 //    // update position of the current aircraft
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: updating aircraft without traffic record at " << SG_ORIGIN);
     } else {
         i->setPositionAndHeading(lat, lon, heading, speed, alt);
@@ -1642,7 +1642,7 @@ void FGApproachController::signOff(int id)
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: Aircraft without traffic record is signing off from approach at " << SG_ORIGIN);
     } else {
         i = activeTraffic.erase(i);
@@ -1671,7 +1671,7 @@ bool FGApproachController::hasInstruction(int id)
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: checking ATC instruction for aircraft without traffic record at " << SG_ORIGIN);
     } else {
         return i->hasInstruction();
@@ -1695,7 +1695,7 @@ FGATCInstruction FGApproachController::getInstruction(int id)
         }
     }
     if (i == activeTraffic.end() || (activeTraffic.size() == 0)) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_ATC, SG_ALERT,
                "AI error: requesting ATC instruction for aircraft without traffic record at " << SG_ORIGIN);
     } else {
         return i->getInstruction();
index 4701a67eea64065ea0f88fb000672d49a726950f..776ec34419e1a433d1aba6fbf8e6def7c0ebec3d 100644 (file)
@@ -226,7 +226,7 @@ void FGATC::Render(string& msg, const float volume,
                                _sgr->add(simple, refname);
                                _sgr->play(refname, repeating);
                        } catch ( sg_io_exception &e ) {
-                               SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage());
+                               SG_LOG(SG_ATC, SG_ALERT, e.getFormattedMessage());
                        }
                }
        }
@@ -300,7 +300,7 @@ std::istream& operator >> ( std::istream& fin, ATCData& a )
                a.type = INVALID;
                return fin >> skipeol;
        default:
-               SG_LOG(SG_GENERAL, SG_ALERT, "Warning - unknown type \'" << tp << "\' found whilst reading ATC frequency data!\n");
+               SG_LOG(SG_ATC, SG_ALERT, "Warning - unknown type \'" << tp << "\' found whilst reading ATC frequency data!\n");
                a.type = INVALID;
                return fin >> skipeol;
        }
index 69a0b117959643a6462f84b52da84c413482807b..334523fd451d2dda3dc6ee52a7ff7730f5eb261b 100644 (file)
@@ -155,7 +155,7 @@ void FGATCMgr::ZapOtherService(const string ncunit, const string svc_name){
         //cout << "Eradicating service: '" << svc->first << "'" << endl;
         svc->second->SetNoDisplay();
         svc->second->Update(0);     // one last update
-        SG_LOG(SG_GENERAL, SG_INFO, "would have erased ATC service:" << svc->second->get_name()<< "/"
+        SG_LOG(SG_ATC, SG_INFO, "would have erased ATC service:" << svc->second->get_name()<< "/"
           << svc->second->get_ident());
         // delete svc->second;
         atc_list->erase(svc);
index 6cdce3d70f41f1a41ad8f44ad82c156852a31151..3ac15621ec80db5471284feae7c2b0e50896171e 100644 (file)
@@ -1176,7 +1176,7 @@ FGTextLayer::setFontName(const string &name)
   FGFontCache *fc = globals->get_fontcache();
   fntFont* font = fc->getTexFont(_font_name.c_str());
   if (!font) {
-      SG_LOG(SG_GENERAL, SG_WARN, "unable to find font:" << name);
+      SG_LOG(SG_COCKPIT, SG_WARN, "unable to find font:" << name);
   }
 }
 
index 8c756c75bf413f8ca50fea4bb4a6ec15ba42c8f4..1231cf6b8a126e796b96457c999f3cb944a0c829 100644 (file)
@@ -1307,7 +1307,7 @@ void Rotor::compile()
         &(torque[1]),&(lift[1])); //pitch b
     rps[0]->calculateAlpha(v_wind,rho_null,0,0,0,
         &(torque[3]),&(lift[3])); //pitch 0
-    SG_LOG(SG_GENERAL, SG_INFO,
+    SG_LOG(SG_FLIGHT, SG_INFO,
         "Rotor: coefficients for airfoil:" << endl << setprecision(6)
         << " drag0: " << _dragcoef0*_number_of_parts/_number_of_blades/_c2
         << " drag1: " << _dragcoef1*_number_of_parts/_number_of_blades/_c2
index d20ade274875bb0a237f6e987177741d8fa5c8c9..24d62735d66bf654979c802b8a61ce09a74e67d1 100644 (file)
@@ -142,7 +142,7 @@ void YASim::init()
     try {
         readXML(f.str(), *_fdm);
     } catch (const sg_exception &e) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_FLIGHT, SG_ALERT,
                "Error reading YASim FDM: '" << f.str() << "'" << std::endl
                << e.getFormattedMessage());
         throw e;
index f1930b0e389ca552e72c1b06e4d75b305be405ad..9a873ed51110c9ef13106f6fea695ce36d948d13 100644 (file)
@@ -234,12 +234,12 @@ static string fgScanForOption( const string& option, int argc, char **argv ) {
         free_hostname = true;
     }
 
-    SG_LOG(SG_GENERAL, SG_INFO, "Scanning command line for: " << option );
+    SG_LOG(SG_INPUT, SG_INFO, "Scanning command line for: " << option );
 
     int len = option.length();
 
     while ( i < argc ) {
-        SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
+        SG_LOG( SG_INPUT, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
 
         string arg = argv[i];
         if ( arg.find( option ) == 0 ) {
@@ -260,7 +260,7 @@ static string fgScanForOption( const string& option, const string& path ) {
         return "";
     }
 
-    SG_LOG( SG_GENERAL, SG_INFO, "Scanning " << path << " for: " << option );
+    SG_LOG( SG_INPUT, SG_INFO, "Scanning " << path << " for: " << option );
 
     int len = option.length();
 
index 386f93dcb18e8bfa3cc81869c7d825177b31ca17..bfde62385875806c35ea7e3d2cc2bdc7cc56dbe6 100644 (file)
@@ -200,7 +200,7 @@ ADF::update (double delta_time_sec)
             if ( sound != NULL )
                 sound->set_volume( volume );
             else
-                SG_LOG( SG_GENERAL, SG_ALERT, "Can't find adf-ident sound" );
+                SG_LOG( SG_INSTR, SG_ALERT, "Can't find adf-ident sound" );
         }
 
         time_t cur_time = globals->get_time_params()->get_cur_time();
index ec78643aa98aaea512d8d008321097e6bc1740ab..f193c5624c0bad1d6b48335dd9b0ebbcc2292ef0 100644 (file)
@@ -808,7 +808,7 @@ void DCLGPS::LoadApproachData() {
                                                                                        w.lat = rwy->begin().getLatitudeRad();
                                                                                        w.lon = rwy->begin().getLongitudeRad();
                                                                                } catch(const sg_exception&) {
-                                                                                       SG_LOG(SG_GENERAL, SG_WARN, "Unable to find runway " << w.id.substr(2, 2) << " at airport " << iap->_aptIdent);
+                                                                                       SG_LOG(SG_INSTR, SG_WARN, "Unable to find runway " << w.id.substr(2, 2) << " at airport " << iap->_aptIdent);
                                                                                        //cout << "Unable to find runway " << w.id.substr(2, 2) << " at airport " << iap->_aptIdent << " ( w.id = " << w.id << ", rwystr = " << rwystr << " )\n";
                                                                                        wp_error = true;
                                                                                }
index 8146cd1f9747c82a31113a0978ef93f41c8ea781..247ffe5fee33b9ecab4f670603e7b524cbdfadde 100644 (file)
@@ -202,7 +202,7 @@ MasterReferenceGyro::update (double dt)
     } else {
         _g_error += (max_g_error /(erect_time * 0.33)) * dt * 2; 
 
-        //SG_LOG(SG_GENERAL, SG_ALERT,_num <<
+        //SG_LOG(SG_INSTR, SG_ALERT,_num <<
         //    " g input " << _g_in_node->getDoubleValue() * gravity
         //    <<" _erect_time " << _erect_time 
         //    << " yaw " <<   yaw_rate
@@ -230,7 +230,7 @@ MasterReferenceGyro::update (double dt)
         if ( diff < -180.0 ) { diff += 360.0; }
         if ( diff > 180.0 ) { diff -= 360.0; }
         _error_out_node->setDoubleValue( diff );
-        //SG_LOG(SG_GENERAL, SG_ALERT,
+        //SG_LOG(SG_INSTR, SG_ALERT,
         //"autopilot input " << bnode->getDoubleValue() 
         //<< " output " << _error_out_node->getDoubleValue()<<);
     }
index 707030ef6f7e0f6bb955cf5eaeda2ae40cae2b54..349d7fdbfd7538534e963e3436f1b7cb08ce5590 100644 (file)
@@ -97,10 +97,10 @@ void FGODGauge::allocRT () {
 //         rt->Reset("rgba ctt");
 
 //     if( rt->Initialize(256, 256, true) ) {
-//         SG_LOG(SG_ALL, SG_INFO, "FGODGauge:Initialize sucessfull");
+//         SG_LOG(SG_INSTR, SG_INFO, "FGODGauge:Initialize sucessfull");
 //         if (rt->BeginCapture())
 //         {
-//             SG_LOG(SG_ALL, SG_INFO, "FGODGauge:BeginCapture sucessfull, RTT available");
+//             SG_LOG(SG_INSTR, SG_INFO, "FGODGauge:BeginCapture sucessfull, RTT available");
 //             rtAvailable = true;
 //             glViewport(0, 0, textureWH, textureWH);
 //             glMatrixMode(GL_PROJECTION);
@@ -124,9 +124,9 @@ void FGODGauge::allocRT () {
 //             glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );
 //             rt->EndCapture();
 //         } else
-//             SG_LOG(SG_ALL, SG_WARN, "FGODGauge:BeginCapture failed, RTT not available, using backbuffer");
+//             SG_LOG(SG_INSTR, SG_WARN, "FGODGauge:BeginCapture failed, RTT not available, using backbuffer");
 //     } else
-//         SG_LOG(SG_ALL, SG_WARN, "FGODGauge:Initialize failed, RTT not available, using backbuffer");
+//         SG_LOG(SG_INSTR, SG_WARN, "FGODGauge:Initialize failed, RTT not available, using backbuffer");
 }
 
 FGODGauge::~FGODGauge() {
index e728b88d2014889d76ea82cf725a6521b6b52877..e0f30e92a1edf1f20e8af537191eb97d4da5105d 100644 (file)
@@ -86,12 +86,12 @@ bool geocRadialIntersection(const SGGeoc& a, double r1, const SGGeoc& b, double
   double ang2 = SGMiscd::normalizeAngle2(crs21-crs23);
     
   if ((sin(ang1) == 0.0) && (sin(ang2) == 0.0)) {
-    SG_LOG(SG_GENERAL, SG_WARN, "geocRadialIntersection: infinity of intersections");
+    SG_LOG(SG_INSTR, SG_WARN, "geocRadialIntersection: infinity of intersections");
     return false;
   }
   
   if ((sin(ang1)*sin(ang2))<0.0) {
-    SG_LOG(SG_GENERAL, SG_WARN, "geocRadialIntersection: intersection ambiguous");
+    SG_LOG(SG_INSTR, SG_WARN, "geocRadialIntersection: intersection ambiguous");
     return false;
   }
   
@@ -320,21 +320,21 @@ public:
     case RESTRICT_AT: {
       double d = curAlt - _waypt->altitudeFt();
       if (fabs(d) < 50.0) {
-        SG_LOG(SG_GENERAL, SG_INFO, "ConstHdgToAltCtl, reached target altitude " << _waypt->altitudeFt());
+        SG_LOG(SG_INSTR, SG_INFO, "ConstHdgToAltCtl, reached target altitude " << _waypt->altitudeFt());
         setDone();
       }
     } break;
       
     case RESTRICT_ABOVE:
       if (curAlt >= _waypt->altitudeFt()) {
-        SG_LOG(SG_GENERAL, SG_INFO, "ConstHdgToAltCtl, above target altitude " << _waypt->altitudeFt());
+        SG_LOG(SG_INSTR, SG_INFO, "ConstHdgToAltCtl, above target altitude " << _waypt->altitudeFt());
         setDone();
       }
       break;
       
     case RESTRICT_BELOW:
       if (curAlt <= _waypt->altitudeFt()) {
-        SG_LOG(SG_GENERAL, SG_INFO, "ConstHdgToAltCtl, below target altitude " << _waypt->altitudeFt());
+        SG_LOG(SG_INSTR, SG_INFO, "ConstHdgToAltCtl, below target altitude " << _waypt->altitudeFt());
         setDone();
       }
       break;
@@ -395,7 +395,7 @@ public:
     double r = SGGeodesy::courseDeg(_waypt->position(), _rnav->position());
     SG_LOG(SG_AUTOPILOT, SG_INFO, "current radial=" << r);
     if (fabs(r - _trueRadial) < 0.5) {
-      SG_LOG(SG_GENERAL, SG_INFO, "InterceptCtl, intercepted radial " << _trueRadial);
+      SG_LOG(SG_INSTR, SG_INFO, "InterceptCtl, intercepted radial " << _trueRadial);
       setDone();
     }
   }
@@ -440,7 +440,7 @@ public:
     _distanceNm = SGGeodesy::distanceNm(_rnav->position(), _dme->position());
     double d = fabs(_distanceNm - _dme->dmeDistanceNm());
     if (d < 0.1) {
-      SG_LOG(SG_GENERAL, SG_INFO, "DMEInterceptCtl, intercepted DME " << _dme->dmeDistanceNm());
+      SG_LOG(SG_INSTR, SG_INFO, "DMEInterceptCtl, intercepted DME " << _dme->dmeDistanceNm());
       setDone();
     }
   }
index d167f78d5719f097e6a7fedec8485e8dcabac463..885754ea22d9db1575059ce68bbb1d62fcb2f46a 100644 (file)
@@ -356,7 +356,7 @@ wxRadarBg::update (double delta_time_sec)
                 _radar_centre_node->setBoolValue(false);
             }
 
-            //SG_LOG(SG_GENERAL, SG_DEBUG, "Radar: displacement "
+            //SG_LOG(SG_INSTR, SG_DEBUG, "Radar: displacement "
             //        << _x_offset <<", "<<_y_offset
             //        << " user_speed_east_fps * SG_FPS_TO_KT "
             //        << user_speed_east_fps * SG_FPS_TO_KT
@@ -538,7 +538,7 @@ wxRadarBg::update_weather()
                     * wxRotate(angle) * _centerTrans);
                 addQuad(_vertices, _texCoords, m, texBase);
 
-                //SG_LOG(SG_GENERAL, SG_DEBUG, "Radar: drawing clouds"
+                //SG_LOG(SG_INSTR, SG_DEBUG, "Radar: drawing clouds"
                 //        << " ID=" << cloudId
                 //        << " x=" << x
                 //        << " y="<< y
@@ -917,7 +917,7 @@ wxRadarBg::update_tacan()
         * wxRotate(angle) * _centerTrans);
     addQuad(_vertices, _texCoords, m, texBase);
 
-    //SG_LOG(SG_GENERAL, SG_DEBUG, "Radar:     drawing TACAN"
+    //SG_LOG(SG_INSTR, SG_DEBUG, "Radar:     drawing TACAN"
     //        << " dist=" << radius
     //        << " view_heading=" << _view_heading * SG_RADIANS_TO_DEGREES
     //        << " bearing=" << angle * SG_RADIANS_TO_DEGREES
@@ -940,7 +940,7 @@ wxRadarBg::update_heading_marker()
     m *= _centerTrans;
     addQuad(_vertices, _texCoords, m, texBase);
 
-    //SG_LOG(SG_GENERAL, SG_DEBUG, "Radar:   drawing heading marker"
+    //SG_LOG(SG_INSTR, SG_DEBUG, "Radar:   drawing heading marker"
     //        << " x,y " << x <<","<< y
     //        << " dist" << dist
     //        << " view_heading" << _view_heading * SG_RADIANS_TO_DEGREES
@@ -989,7 +989,7 @@ wxRadarBg::withinRadarHorizon(double user_alt, double alt, double range_nm)
         alt = 0; // to allow some vertical extent of target
 
     double radarhorizon = 1.23 * (sqrt(alt) + sqrt(user_alt));
-//    SG_LOG(SG_GENERAL, SG_ALERT, "Radar: radar horizon " << radarhorizon);
+//    SG_LOG(SG_INSTR, SG_ALERT, "Radar: radar horizon " << radarhorizon);
     return radarhorizon >= range_nm;
 }
 
@@ -1017,7 +1017,7 @@ wxRadarBg::inRadarRange(double sigma, double range_nm)
         constant = 35;
 
     double maxrange = constant * pow(sigma, 0.25);
-    //SG_LOG(SG_GENERAL, SG_DEBUG, "Radar: max range " << maxrange);
+    //SG_LOG(SG_INSTR, SG_DEBUG, "Radar: max range " << maxrange);
     return maxrange >= range_nm;
 }
 
index 103fafecd96ed7d0dc423ede1a5df174f82d0f4f..c12026434453f00a4489499c86517c447134d27b 100644 (file)
@@ -127,7 +127,7 @@ addLoggingClass (const string &name)
 /**
  * Set the logging classes.
  */
-static void
+void
 setLoggingClasses (const char * c)
 {
   string classes = c;
@@ -147,12 +147,16 @@ setLoggingClasses (const char * c)
 
   string rest = classes;
   string name = "";
-  int sep = rest.find('|');
-  while (sep > 0) {
+  string::size_type sep = rest.find('|');
+  if (sep == string::npos)
+    sep = rest.find(',');
+  while (sep != string::npos) {
     name = rest.substr(0, sep);
     rest = rest.substr(sep+1);
     addLoggingClass(name);
     sep = rest.find('|');
+    if (sep == string::npos)
+      sep = rest.find(',');
   }
   addLoggingClass(rest);
   SG_LOG(SG_GENERAL, SG_INFO, "Set logging classes to "
@@ -188,7 +192,7 @@ getLoggingPriority ()
 /**
  * Set the logging priority.
  */
-static void
+void
 setLoggingPriority (const char * p)
 {
   if (p == 0)
index d4d7ef1c83ae3e15eb5ec6fc30eb5e79bbd552b8..756ac763b349d48dddd01441f64c5b6137927e1a 100644 (file)
@@ -70,6 +70,8 @@ extern bool fgLoadFlight (std::istream &input);
 extern bool fgLoadProps (const char * path, SGPropertyNode * props,
                          bool in_fg_root = true, int default_mode = 0);
 
+void setLoggingClasses (const char * c);
+void setLoggingPriority (const char * p);
 
 \f
 ////////////////////////////////////////////////////////////////////////
index 837bca13bd27a0b6cfe33ae0fd18962c4d5da9f4..d717666718518feed50c3106a8679747de6093ce 100644 (file)
@@ -900,29 +900,20 @@ fgOptTraceRead( const char *arg )
 static int
 fgOptLogLevel( const char *arg )
 {
-    fgSetString("/sim/logging/classes", "all");
     fgSetString("/sim/logging/priority", arg);
-
-    string priority = arg;
-    logbuf::set_log_classes(SG_ALL);
-    if (priority == "bulk") {
-      logbuf::set_log_priority(SG_BULK);
-    } else if (priority == "debug") {
-      logbuf::set_log_priority(SG_DEBUG);
-    } else if (priority == "info") {
-      logbuf::set_log_priority(SG_INFO);
-    } else if (priority == "warn") {
-      logbuf::set_log_priority(SG_WARN);
-    } else if (priority == "alert") {
-      logbuf::set_log_priority(SG_ALERT);
-    } else {
-      SG_LOG(SG_GENERAL, SG_WARN, "Unknown logging priority " << priority);
-    }
-    SG_LOG(SG_GENERAL, SG_DEBUG, "Logging priority is " << priority);
+    setLoggingPriority(arg);
 
     return FG_OPTIONS_OK;
 }
 
+static int
+fgOptLogClasses( const char *arg )
+{
+    fgSetString("/sim/logging/classes", arg);
+    setLoggingClasses (arg);
+
+    return FG_OPTIONS_OK;
+}
 
 static int
 fgOptTraceWrite( const char *arg )
@@ -1499,6 +1490,7 @@ struct OptionDesc {
     {"trace-read",                   true,  OPTION_FUNC | OPTION_MULTI,   "", false, "", fgOptTraceRead },
     {"trace-write",                  true,  OPTION_FUNC | OPTION_MULTI,   "", false, "", fgOptTraceWrite },
     {"log-level",                    true,  OPTION_FUNC,   "", false, "", fgOptLogLevel },
+    {"log-class",                    true,  OPTION_FUNC,   "", false, "", fgOptLogClasses },
     {"view-offset",                  true,  OPTION_FUNC | OPTION_MULTI,   "", false, "", fgOptViewOffset },
     {"visibility",                   true,  OPTION_FUNC,   "", false, "", fgOptVisibilityMeters },
     {"visibility-miles",             true,  OPTION_FUNC,   "", false, "", fgOptVisibilityMiles },
index 3b0658b0a7173f82051da959778c729358c30a89..f17459e8ae7c436c94750fa45b58d98ec68393e3 100644 (file)
@@ -67,9 +67,9 @@ FGAircraftModel::init ()
     osg::Node *model = fgLoad3DModelPanel( path, globals->get_props());
     _aircraft->init( model );
   } catch (const sg_exception &ex) {
-    SG_LOG(SG_GENERAL, SG_ALERT, "Failed to load aircraft from " << path << ':');
-    SG_LOG(SG_GENERAL, SG_ALERT, "  " << ex.getFormattedMessage());
-    SG_LOG(SG_GENERAL, SG_ALERT, "(Falling back to glider.ac.)");
+    SG_LOG(SG_AIRCRAFT, SG_ALERT, "Failed to load aircraft from " << path << ':');
+    SG_LOG(SG_AIRCRAFT, SG_ALERT, "  " << ex.getFormattedMessage());
+    SG_LOG(SG_AIRCRAFT, SG_ALERT, "(Falling back to glider.ac.)");
     osg::Node *model = fgLoad3DModelPanel( "Models/Geometry/glider.ac",
                                            globals->get_props());
     _aircraft->init( model );
index 139cf2d4f2441eb00e5c7fff7a1694d5c0abd32c..142d7af4080d95b313853bdbb3c9757330f073e6 100644 (file)
@@ -68,7 +68,7 @@ FGModelMgr::init ()
 void
 FGModelMgr::add_model (SGPropertyNode * node)
 {
-  SG_LOG(SG_GENERAL, SG_INFO,
+  SG_LOG(SG_AIRCRAFT, SG_INFO,
          "Adding model " << node->getStringValue("name", "[unnamed]"));
 
   const char *path = node->getStringValue("path", "Models/Geometry/glider.ac");
@@ -77,7 +77,7 @@ FGModelMgr::add_model (SGPropertyNode * node)
   try {
       object = SGModelLib::loadDeferredModel(path, globals->get_props());
   } catch (const sg_throwable& t) {
-    SG_LOG(SG_GENERAL, SG_ALERT, "Error loading " << path << ":\n  "
+    SG_LOG(SG_AIRCRAFT, SG_ALERT, "Error loading " << path << ":\n  "
         << t.getFormattedMessage() << t.getOrigin());
     return;
   }
@@ -181,7 +181,7 @@ struct UpdateFunctor : public std::unary_function<FGModelMgr::Instance*, void>
         } catch (const sg_range_exception&) {
             const char *path = instance->node->getStringValue("path",
                                                               "unknown");
-            SG_LOG(SG_GENERAL, SG_INFO, "Instance of model " << path
+            SG_LOG(SG_AIRCRAFT, SG_INFO, "Instance of model " << path
                    << " has invalid values");
             return;
         }
index 546f03ebee04cb92afac573f1c61903cb4bd13b6..b3cefd228c30cd7b18142051407ab6556c046a06 100644 (file)
@@ -98,7 +98,7 @@ void FGATCMain::init_config() {
         SGPath atcsim_config( envp );
         atcsim_config.append( ".fgfs-atc610x.xml" );
        try {
-         SG_LOG(SG_GENERAL, SG_ALERT,
+         SG_LOG(SG_NETWORK, SG_ALERT,
                 "Warning: loading deprecated config file: " <<
                 atcsim_config.str() );
          readProperties( atcsim_config.str(), globals->get_props() );
@@ -224,7 +224,7 @@ bool FGATCMain::process() {
     FGNasalSys *n = (FGNasalSys*)globals->get_subsystem("nasal");
     bool result = n->parseAndRun( "atcsim.update()" );
     if ( !result ) {
-        SG_LOG( SG_GENERAL, SG_ALERT, "Nasal: atcsim.update() failed!" );
+        SG_LOG( SG_NETWORK, SG_ALERT, "Nasal: atcsim.update() failed!" );
     }
 
     // process the ATC outputs
index eb0bd63ba66c5f01569643f0d3563417e9ba215d..8a3aa440f5861a50f7a57b531087e837c130efc1 100644 (file)
@@ -55,7 +55,7 @@ FGGeneric::FGGeneric(vector<string> tokens) : exitOnError(false)
     }
 
     if (configToken >= tokens.size()) {
-       SG_LOG(SG_GENERAL, SG_ALERT,
+       SG_LOG(SG_NETWORK, SG_ALERT,
               "Not enough tokens passed for generic protocol");
        return;
     }
@@ -65,7 +65,7 @@ FGGeneric::FGGeneric(vector<string> tokens) : exitOnError(false)
     direction = tokens[2];
 
     if (direction != "in" && direction != "out" && direction != "bi") {
-        SG_LOG(SG_GENERAL, SG_ALERT, "Unsuported protocol direction: "
+        SG_LOG(SG_NETWORK, SG_ALERT, "Unsuported protocol direction: "
                << direction);
     }
 
@@ -543,14 +543,14 @@ FGGeneric::reinit()
     path.append("Protocol");
     path.append(file_name.c_str());
 
-    SG_LOG(SG_GENERAL, SG_INFO, "Reading communication protocol from "
+    SG_LOG(SG_NETWORK, SG_INFO, "Reading communication protocol from "
                                 << path.str());
 
     SGPropertyNode root;
     try {
         readProperties(path.str(), &root);
     } catch (const sg_exception & ex) {
-        SG_LOG(SG_GENERAL, SG_ALERT,
+        SG_LOG(SG_NETWORK, SG_ALERT,
          "Unable to load the protocol configuration file: " << ex.getFormattedMessage() );
          return;
     }
index 31d4b93375af4724799b0b1184b99a102ed29df1..f301f552d5b2c6ebad9b639903a3621c261271f5 100644 (file)
@@ -147,7 +147,7 @@ void HttpdChannel::foundTerminator (void) {
                             if ( !globals->get_commands()
                                  ->execute(urlDecode(b).c_str(), &args) )
                             {
-                                SG_LOG( SG_GENERAL, SG_ALERT,
+                                SG_LOG( SG_NETWORK, SG_ALERT,
                                         "Command " << urlDecode(b)
                                         << " failed.");
                             }
index ac1b6ee9702633f1d166d45e19ab3b05f9a6b6b7..7240d5cb236bcd360f1371ce348e909479bc0df2 100644 (file)
@@ -292,7 +292,7 @@ PropsChannel::foundTerminator()
                     if ( !globals->get_commands()
                              ->execute( "reinit", &args) )
                     {
-                        SG_LOG( SG_GENERAL, SG_ALERT,
+                        SG_LOG( SG_NETWORK, SG_ALERT,
                                 "Command " << tokens[1] << " failed.");
                         if ( mode == PROMPT ) {
                             tmp += "*failed*";
@@ -357,7 +357,7 @@ PropsChannel::foundTerminator()
                     if ( !globals->get_commands()
                              ->execute(tokens[1].c_str(), &args) )
                     {
-                        SG_LOG( SG_GENERAL, SG_ALERT,
+                        SG_LOG( SG_NETWORK, SG_ALERT,
                                 "Command " << tokens[1] << " failed.");
                         if ( mode == PROMPT ) {
                             tmp += "*failed*";
index 0134dcb264ee1a621fb324c26f4e7353add2857e..777d1eedea4082c80ee51f4ad25f99f29d022c31 100644 (file)
@@ -215,7 +215,7 @@ static naRef f_getprop(naContext c, naRef me, int argc, naRef* args)
         {
         double dv = p->getDoubleValue();
         if (osg::isNaN(dv)) {
-          SG_LOG(SG_GENERAL, SG_ALERT, "Nasal getprop: property " << p->getPath() << " is NaN");
+          SG_LOG(SG_NASAL, SG_ALERT, "Nasal getprop: property " << p->getPath() << " is NaN");
           return naNil();
         }
         
@@ -294,7 +294,7 @@ static naRef f_print(naContext c, naRef me, int argc, naRef* args)
         if(naIsNil(s)) continue;
         buf += naStr_data(s);
     }
-    SG_LOG(SG_GENERAL, SG_ALERT, buf);
+    SG_LOG(SG_NASAL, SG_ALERT, buf);
     return naNum(buf.length());
 }
 
index 15a3016f3f31c9f1669625100132fe543d6c053a..0233b69ddada6eb8a4ee02a4168f82cf904105ee 100644 (file)
@@ -174,7 +174,7 @@ static naRef f_getValue(naContext c, naRef me, int argc, naRef* args)
     {
         double dv = (*node)->getDoubleValue();
         if (osg::isNaN(dv)) {
-          SG_LOG(SG_GENERAL, SG_ALERT, "Nasal getValue: property " << (*node)->getPath() << " is NaN");
+          SG_LOG(SG_NASAL, SG_ALERT, "Nasal getValue: property " << (*node)->getPath() << " is NaN");
           return naNil();
         }