]> git.mxchange.org Git - flightgear.git/commitdiff
Use more specific logging classes for SG_LOG.
authorThorstenB <brehmt@gmail.com>
Fri, 23 Nov 2012 20:14:40 +0000 (21:14 +0100)
committerThorstenB <brehmt@gmail.com>
Fri, 23 Nov 2012 20:16:08 +0000 (21:16 +0100)
The log filters aren't really useful when everything uses SG_GENERAL.

17 files changed:
src/Main/fg_props.cxx
src/Navaids/FlightPlan.cxx
src/Navaids/LevelDXML.cxx
src/Navaids/NavDataCache.cxx
src/Navaids/airways.cxx
src/Navaids/awynet.cxx
src/Navaids/fixlist.cxx
src/Navaids/navdb.cxx
src/Navaids/navlist.cxx
src/Navaids/positioned.cxx
src/Navaids/procedure.cxx
src/Navaids/route.cxx
src/Navaids/routePath.cxx
src/Navaids/waypoint.cxx
src/Traffic/SchedFlight.cxx
src/Traffic/Schedule.cxx
src/Traffic/TrafficMgr.cxx

index d8bda0f0829e9b67796f5f3a5f4b2a78a356c954..2d21e2dc2eac4830f67791e5571b9e3968f800f4 100644 (file)
@@ -79,6 +79,7 @@ LogClassMapping log_class_mappings [] = {
   LogClassMapping(SG_AI, "ai"),
   LogClassMapping(SG_ENVIRONMENT, "environment"),
   LogClassMapping(SG_SOUND, "sound"),
+  LogClassMapping(SG_NAVAID, "navaid"),
   LogClassMapping(SG_UNDEFD, "")
 };
 
index af82fa250969402b04e711482659421c98a926e8..3f3eff4f6dc7e11836349cabd0ccfbd8dd700b2b 100644 (file)
@@ -189,7 +189,7 @@ void FlightPlan::deleteIndex(int aIndex)
   }
   
   if ((index < 0) || (index >= numLegs())) {
-    SG_LOG(SG_AUTOPILOT, SG_WARN, "removeAtIndex with invalid index:" << aIndex);
+    SG_LOG(SG_NAVAID, SG_WARN, "removeAtIndex with invalid index:" << aIndex);
     return;
   }
   
@@ -511,7 +511,7 @@ void FlightPlan::setApproach(flightgear::Approach *app)
   
 bool FlightPlan::save(const SGPath& path)
 {
-  SG_LOG(SG_IO, SG_INFO, "Saving route to " << path.str());
+  SG_LOG(SG_NAVAID, SG_INFO, "Saving route to " << path.str());
   try {
     SGPropertyNode_ptr d(new SGPropertyNode);
     d->setIntValue("version", 2);
@@ -553,7 +553,7 @@ bool FlightPlan::save(const SGPath& path)
     writeProperties(path.str(), d, true /* write-all */);
     return true;
   } catch (sg_exception& e) {
-    SG_LOG(SG_IO, SG_ALERT, "Failed to save flight-plan '" << path.str() << "'. " << e.getMessage());
+    SG_LOG(SG_NAVAID, SG_ALERT, "Failed to save flight-plan '" << path.str() << "'. " << e.getMessage());
     return false;
   }
 }
@@ -562,13 +562,13 @@ bool FlightPlan::load(const SGPath& path)
 {
   if (!path.exists())
   {
-    SG_LOG(SG_IO, SG_ALERT, "Failed to load flight-plan '" << path.str()
+    SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << path.str()
            << "'. The file does not exist.");
     return false;
   }
   
   SGPropertyNode_ptr routeData(new SGPropertyNode);
-  SG_LOG(SG_IO, SG_INFO, "going to read flight-plan from:" << path.str());
+  SG_LOG(SG_NAVAID, SG_INFO, "going to read flight-plan from:" << path.str());
   
   bool Status = false;
   lockDelegate();
@@ -594,7 +594,7 @@ bool FlightPlan::load(const SGPath& path)
       }
       Status = true;
     } catch (sg_exception& e) {
-      SG_LOG(SG_IO, SG_ALERT, "Failed to load flight-plan '" << e.getOrigin()
+      SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load flight-plan '" << e.getOrigin()
              << "'. " << e.getMessage());
       Status = false;
     }
@@ -764,7 +764,7 @@ bool FlightPlan::loadPlainTextRoute(const SGPath& path)
       _legs.push_back(new Leg(this, w));
     } // of line iteration
   } catch (sg_exception& e) {
-    SG_LOG(SG_IO, SG_ALERT, "Failed to load route from: '" << path.str() << "'. " << e.getMessage());
+    SG_LOG(SG_NAVAID, SG_ALERT, "Failed to load route from: '" << path.str() << "'. " << e.getMessage());
     _legs.clear();
     return false;
   }
@@ -824,7 +824,7 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
   string_list pieces(simgear::strutils::split(target, "/"));
   FGPositionedRef p = FGPositioned::findClosestWithIdent(pieces.front(), basePosition);
   if (!p) {
-    SG_LOG( SG_AUTOPILOT, SG_INFO, "Unable to find FGPositioned with ident:" << pieces.front());
+    SG_LOG( SG_NAVAID, SG_INFO, "Unable to find FGPositioned with ident:" << pieces.front());
     return NULL;
   }
   
@@ -841,12 +841,12 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
   } else if (pieces.size() == 2) {
     FGAirport* apt = dynamic_cast<FGAirport*>(p.ptr());
     if (!apt) {
-      SG_LOG(SG_AUTOPILOT, SG_INFO, "Waypoint is not an airport:" << pieces.front());
+      SG_LOG(SG_NAVAID, SG_INFO, "Waypoint is not an airport:" << pieces.front());
       return NULL;
     }
     
     if (!apt->hasRunwayWithIdent(pieces[1])) {
-      SG_LOG(SG_AUTOPILOT, SG_INFO, "No runway: " << pieces[1] << " at " << pieces[0]);
+      SG_LOG(SG_NAVAID, SG_INFO, "No runway: " << pieces[1] << " at " << pieces[0]);
       return NULL;
     }
     
@@ -856,7 +856,7 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
     // navid/radial/navid/radial notation     
     FGPositionedRef p2 = FGPositioned::findClosestWithIdent(pieces[2], basePosition);
     if (!p2) {
-      SG_LOG( SG_AUTOPILOT, SG_INFO, "Unable to find FGPositioned with ident:" << pieces[2]);
+      SG_LOG( SG_NAVAID, SG_INFO, "Unable to find FGPositioned with ident:" << pieces[2]);
       return NULL;
     }
     
@@ -868,7 +868,7 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
     SGGeod intersection;
     bool ok = SGGeodesy::radialIntersection(p->geod(), r1, p2->geod(), r2, intersection);
     if (!ok) {
-      SG_LOG(SG_AUTOPILOT, SG_INFO, "no valid intersection for:" << target);
+      SG_LOG(SG_NAVAID, SG_INFO, "no valid intersection for:" << target);
       return NULL;
     }
     
@@ -877,7 +877,7 @@ WayptRef FlightPlan::waypointFromString(const string& tgt )
   }
   
   if (!wpt) {
-    SG_LOG(SG_AUTOPILOT, SG_INFO, "Unable to parse waypoint:" << target);
+    SG_LOG(SG_NAVAID, SG_INFO, "Unable to parse waypoint:" << target);
     return NULL;
   }
   
index 49ab15d3f0f6db0e44a49d5e9e15281c6277b72e..41866cb71611fe66bbc1a76bd788f70b8e6a5aad 100644 (file)
@@ -250,7 +250,7 @@ Waypt* NavdataVisitor::buildWaypoint(RouteBase* owner)
     SGGeodesy::direct(pos, _course, _dmeDistance, pos2, az2);
     wp = new BasicWaypt(pos2, _wayptName, owner);
   } else {
-    SG_LOG(SG_GENERAL, SG_ALERT, "implement waypoint type:" << _wayptType);
+    SG_LOG(SG_NAVAID, SG_ALERT, "implement waypoint type:" << _wayptType);
     throw sg_format_exception("Unrecognized waypt type", _wayptType);
   }
   
@@ -327,11 +327,11 @@ void NavdataVisitor::pi (const char * target, const char * data) {
 }
 
 void NavdataVisitor::warning (const char * message, int line, int column) {
-  SG_LOG(SG_IO, SG_WARN, "Warning: " << message << " (" << line << ',' << column << ')');
+  SG_LOG(SG_NAVAID, SG_WARN, "Warning: " << message << " (" << line << ',' << column << ')');
 }
 
 void NavdataVisitor::error (const char * message, int line, int column) {
-  SG_LOG(SG_IO, SG_ALERT, "Error: " << message << " (" << line << ',' << column << ')');
+  SG_LOG(SG_NAVAID, SG_ALERT, "Error: " << message << " (" << line << ',' << column << ')');
 }
 
 }
index 17937f926ca5cf417405a0cff4241844c1b0bcef..e7d885ef074548129a69a440c3788207410d3727 100644 (file)
@@ -65,7 +65,7 @@
 
 using std::string;
 
-#define SG_NAVCACHE SG_GENERAL
+#define SG_NAVCACHE SG_NAVAID
 //#define LAZY_OCTREE_UPDATES 1
 
 namespace {
@@ -163,7 +163,7 @@ public:
     SGTimeStamp st;
     st.stamp();
     _cache->doRebuild();
-    SG_LOG(SG_GENERAL, SG_INFO, "cache rebuild took:" << st.elapsedMSec() << "msec");
+    SG_LOG(SG_NAVCACHE, SG_INFO, "cache rebuild took:" << st.elapsedMSec() << "msec");
     
     SGGuard<SGMutex> g(_lock);
     _isFinished = true;
@@ -1338,7 +1338,7 @@ PositionedID NavDataCache::insertAirport(FGPositioned::Type ty, const string& id
 void NavDataCache::updatePosition(PositionedID item, const SGGeod &pos)
 {
   if (d->cache.find(item) != d->cache.end()) {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "updating position of an item in the cache");
+    SG_LOG(SG_NAVCACHE, SG_DEBUG, "updating position of an item in the cache");
     d->cache[item]->modifyPosition(pos);
   }
   
index e43687b1d6975a8d35b92d5b40b3919a747afc57..70ff237c7538c929c6331fe824fad440b897fc4e 100644 (file)
@@ -131,7 +131,7 @@ void Airway::load(const SGPath& path)
 
   sg_gzifstream in( path.str() );
   if ( !in.is_open() ) {
-    SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+    SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
     throw sg_io_exception("Could not open airways data", sg_location(path.str()));
   }
 // toss the first two lines of the file
@@ -174,13 +174,13 @@ void Airway::Network::addEdge(int aWay, const SGGeod& aStartPos,
   FGPositionedRef end = FGPositioned::findClosestWithIdent(aEndIdent, aEndPos);
     
   if (!start) {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "unknown airways start pt: '" << aStartIdent << "'");
+    SG_LOG(SG_NAVAID, SG_DEBUG, "unknown airways start pt: '" << aStartIdent << "'");
     start = FGPositioned::createUserWaypoint(aStartIdent, aStartPos);
     return;
   }
   
   if (!end) {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "unknown airways end pt: '" << aEndIdent << "'");
+    SG_LOG(SG_NAVAID, SG_DEBUG, "unknown airways end pt: '" << aEndIdent << "'");
     end = FGPositioned::createUserWaypoint(aEndIdent, aEndPos);
     return;
   }
@@ -219,8 +219,8 @@ bool Airway::Network::route(WayptRef aFrom, WayptRef aTo,
   boost::tie(to, exactTo) = findClosestNode(aTo);
   
 #ifdef DEBUG_AWY_SEARCH
-  SG_LOG(SG_GENERAL, SG_INFO, "from:" << from->ident() << "/" << from->name());
-  SG_LOG(SG_GENERAL, SG_INFO, "to:" << to->ident() << "/" << to->name());
+  SG_LOG(SG_NAVAID, SG_INFO, "from:" << from->ident() << "/" << from->name());
+  SG_LOG(SG_NAVAID, SG_INFO, "to:" << to->ident() << "/" << to->name());
 #endif
 
   bool ok = search2(from, to, aPath);
@@ -348,7 +348,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
     closedNodes.insert(xp->guid());
   
 #ifdef DEBUG_AWY_SEARCH
-    SG_LOG(SG_GENERAL, SG_INFO, "x:" << xp->ident() << ", f(x)=" << x->totalCost());
+    SG_LOG(SG_NAVAID, SG_INFO, "x:" << xp->ident() << ", f(x)=" << x->totalCost());
 #endif
     
   // check if xp is the goal; if so we're done, since there cannot be an open
@@ -373,7 +373,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
         if (g > y->distanceFromStart) {
           // worse path, ignore
 #ifdef DEBUG_AWY_SEARCH
-          SG_LOG(SG_GENERAL, SG_INFO, "\tabandoning " << yp->ident() <<
+          SG_LOG(SG_NAVAID, SG_INFO, "\tabandoning " << yp->ident() <<
            " path is worse: g(y)" << y->distanceFromStart << ", g'=" << g);
 #endif
           continue;
@@ -382,7 +382,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
       // we need to update y. Unfortunately this means rebuilding the heap,
       // since y's score can change arbitrarily
 #ifdef DEBUG_AWY_SEARCH
-        SG_LOG(SG_GENERAL, SG_INFO, "\tfixing up previous for new path to " << yp->ident() << ", d =" << g);
+        SG_LOG(SG_NAVAID, SG_INFO, "\tfixing up previous for new path to " << yp->ident() << ", d =" << g);
 #endif
         y->previous = x;
         y->distanceFromStart = g;
@@ -391,7 +391,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
       } else { // not open, insert a new node for y into the heap
         y = new AStarOpenNode(yp, edgeDistanceM, other.first, aDest, x);
 #ifdef DEBUG_AWY_SEARCH
-        SG_LOG(SG_GENERAL, SG_INFO, "\ty=" << yp->ident() << ", f(y)=" << y->totalCost());
+        SG_LOG(SG_NAVAID, SG_INFO, "\ty=" << yp->ident() << ", f(y)=" << y->totalCost());
 #endif
         openNodes.push_back(y);
         std::push_heap(openNodes.begin(), openNodes.end(), ordering);
@@ -399,7 +399,7 @@ bool Airway::Network::search2(FGPositionedRef aStart, FGPositionedRef aDest,
     } // of neighbour iteration
   } // of open node iteration
   
-  SG_LOG(SG_GENERAL, SG_INFO, "A* failed to find route");
+  SG_LOG(SG_NAVAID, SG_INFO, "A* failed to find route");
   return false;
 }
 
index 3ed794c1744e42556d1fdaea82af9c43f20820b9..7642673b5fc6ec5857347948d6aaf9cdf7ceae82 100644 (file)
@@ -207,7 +207,7 @@ void FGAirwayNetwork::load(const SGPath& path)
 
   sg_gzifstream in( path.str() );
   if ( !in.is_open() ) {
-    SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+    SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
     exit(-1);
   }
   // toss the first two lines of the file
@@ -364,7 +364,7 @@ FGAirRoute FGAirwayNetwork::findShortestRoute(int start, int end)
 
   if (!foundRoute)
     {
-      SG_LOG( SG_GENERAL, SG_INFO, "Failed to find route from waypoint " << start << " to " << end );
+      SG_LOG( SG_NAVAID, SG_INFO, "Failed to find route from waypoint " << start << " to " << end );
       cerr << "Failed to find route from waypoint " << start << " to " << end << endl;
       //exit(1);
     }
@@ -458,7 +458,7 @@ void FGAirwayNetwork::trace(FGNode *currNode, int end, int depth, double distanc
     }
   else
     {
-      //SG_LOG( SG_GENERAL, SG_DEBUG, "4" );
+      //SG_LOG( SG_NAVAID, SG_DEBUG, "4" );
       //cerr << "4" << endl;
     }
   traceStack.pop_back();
index eb71baa0d4257a43a1656665f1c00a692581a8ee..2dc8806eab1dfaacb45ea7c1790c7a441b031bf6 100644 (file)
@@ -49,7 +49,7 @@ void loadFixes(const SGPath& path)
 {
   sg_gzifstream in( path.str() );
   if ( !in.is_open() ) {
-    SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+    SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
     exit(-1);
   }
   
index 5c592c1c4bbed9b6f7c178e22ef080f5f9c7e8c1..b94f1a3f8475f1d34fb0c109464544fcd5ecc6f5 100644 (file)
@@ -97,7 +97,7 @@ void alignLocaliserWithRunway(FGRunway* rwy, const string& ident, SGGeod& pos, d
     pos = SGGeod::fromGeodFt(newPos, pos.getElevationFt());
     heading = rwy->headingDeg();
   } else {
-    SG_LOG(SG_GENERAL, SG_DEBUG, "localizer:" << ident << ", aligning with runway "
+    SG_LOG(SG_NAVAID, SG_DEBUG, "localizer:" << ident << ", aligning with runway "
            << rwy->ident() << " exceeded heading threshold");
   }
 }
@@ -107,7 +107,7 @@ static double defaultNavRange(const string& ident, FGPositioned::Type type)
   // Ranges are included with the latest data format, no need to
   // assign our own defaults, unless the range is not set for some
   // reason.
-  SG_LOG(SG_GENERAL, SG_DEBUG, "navaid " << ident << " has no range set, using defaults");
+  SG_LOG(SG_NAVAID, SG_DEBUG, "navaid " << ident << " has no range set, using defaults");
   switch (type) {
     case FGPositioned::NDB:
     case FGPositioned::VOR:
@@ -216,7 +216,7 @@ bool navDBInit(const SGPath& path)
 {
     sg_gzifstream in( path.str() );
     if ( !in.is_open() ) {
-        SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+        SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
       return false;
     }
   
@@ -238,11 +238,11 @@ bool navDBInit(const SGPath& path)
   
 bool loadCarrierNav(const SGPath& path)
 {    
-    SG_LOG( SG_GENERAL, SG_INFO, "opening file: " << path.str() );    
+    SG_LOG( SG_NAVAID, SG_INFO, "opening file: " << path.str() );    
     sg_gzifstream incarrier( path.str() );
     
     if ( !incarrier.is_open() ) {
-        SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+        SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
       return false;
     }
     
@@ -256,11 +256,11 @@ bool loadCarrierNav(const SGPath& path)
   
 bool loadTacan(const SGPath& path, FGTACANList *channellist)
 {
-    SG_LOG( SG_GENERAL, SG_INFO, "opening file: " << path.str() );
+    SG_LOG( SG_NAVAID, SG_INFO, "opening file: " << path.str() );
     sg_gzifstream inchannel( path.str() );
     
     if ( !inchannel.is_open() ) {
-        SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << path.str() );
+        SG_LOG( SG_NAVAID, SG_ALERT, "Cannot open file: " << path.str() );
       return false;
     }
     
index d63b958f648616da0b04f03947e75cf6a455966b..eb6bac7547b2d80060f488e65b42e8fa1e422f49 100644 (file)
@@ -302,7 +302,7 @@ bool FGTACANList::add( FGTACANRecord *c )
 FGTACANRecord *FGTACANList::findByChannel( const string& channel )
 {
     const tacan_list_type& stations = ident_channels[channel];
-    SG_LOG( SG_INSTR, SG_DEBUG, "findByChannel " << channel<< " size " << stations.size() );
+    SG_LOG( SG_NAVAID, SG_DEBUG, "findByChannel " << channel<< " size " << stations.size() );
 
     if (!stations.empty()) {
         return stations[0];
index 18bb22f62b6e6717e494b5efe1680d5930dc3e01..bced11728b6064a703689c3fb499dbddb75c5e30 100644 (file)
@@ -131,7 +131,7 @@ FGPositioned::Type FGPositioned::typeFromName(const std::string& aName)
     }
   }
   
-  SG_LOG(SG_GENERAL, SG_WARN, "FGPositioned::typeFromName: couldn't match:" << aName);
+  SG_LOG(SG_NAVAID, SG_WARN, "FGPositioned::typeFromName: couldn't match:" << aName);
   return INVALID;
 }
 
index 94afcdd2c69b3cd9f9e6a64dff5696ad0e650705..f94ec0cc1cd03312d670b45a7d067dcd4504071c 100644 (file)
@@ -114,7 +114,7 @@ bool Approach::route(WayptRef aIAF, WayptVec& aWps)
     } // of transitions iteration
     
     if (!haveTrans) {
-      SG_LOG(SG_GENERAL, SG_INFO, "approach " << ident() << " has no transition " <<
+      SG_LOG(SG_NAVAID, SG_INFO, "approach " << ident() << " has no transition " <<
         "for IAF: " << aIAF->ident());
       return false;
     }
@@ -250,7 +250,7 @@ bool ArrivalDeparture::commonRoute(Transition* t, WayptVec& aPath, FGRunwayRef a
     return true;
   }
   
-  SG_LOG(SG_GENERAL, SG_INFO, ident() << " using runway transition for " << r->first->ident());
+  SG_LOG(SG_NAVAID, SG_INFO, ident() << " using runway transition for " << r->first->ident());
   r->second->route(aPath);
   return true;
 }
@@ -264,7 +264,7 @@ Transition* ArrivalDeparture::findTransitionByEnroute(Waypt* aEnroute) const
   WptTransitionMap::const_iterator eit;
   for (eit = _enrouteTransitions.begin(); eit != _enrouteTransitions.end(); ++eit) {
     if (eit->second->enroute()->matches(aEnroute)) {
-      SG_LOG(SG_GENERAL, SG_INFO, ident() << " using enroute transition " << eit->second->ident());
+      SG_LOG(SG_NAVAID, SG_INFO, ident() << " using enroute transition " << eit->second->ident());
       return eit->second;
     }
   } // of enroute transition iteration
@@ -276,7 +276,7 @@ WayptRef ArrivalDeparture::findBestTransition(const SGGeod& aPos) const
 {
   // no transitions, that's easy
   if (_enrouteTransitions.empty()) {
-    SG_LOG(SG_GENERAL, SG_INFO, "no enroute transitions for " << ident());
+    SG_LOG(SG_NAVAID, SG_INFO, "no enroute transitions for " << ident());
     return _common.front();
   }
   
@@ -285,7 +285,7 @@ WayptRef ArrivalDeparture::findBestTransition(const SGGeod& aPos) const
   WptTransitionMap::const_iterator eit;
   for (eit = _enrouteTransitions.begin(); eit != _enrouteTransitions.end(); ++eit) {
     WayptRef c = eit->second->enroute();
-    SG_LOG(SG_GENERAL, SG_INFO, "findBestTransition for " << ident() << ", looking at " << c->ident());
+    SG_LOG(SG_NAVAID, SG_INFO, "findBestTransition for " << ident() << ", looking at " << c->ident());
     // assert(c->hasFixedPosition());
     double cd = SGGeodesy::distanceM(aPos, c->position());
     
@@ -321,7 +321,7 @@ SID::SID(const string& aIdent, FGAirport* apt) :
 bool SID::route(FGRunwayRef aWay, Transition* trans, WayptVec& aPath)
 {
   if (!isForRunway(aWay)) {
-    SG_LOG(SG_GENERAL, SG_WARN, "SID " << ident() << " not for runway " << aWay->ident());
+    SG_LOG(SG_NAVAID, SG_WARN, "SID " << ident() << " not for runway " << aWay->ident());
     return false;
   }
   
index b52a3f5746f60221373bff2ac273b5afcac33abc..952860c4d653e490690a5112ca4e40cf6a3fb416 100644 (file)
@@ -330,7 +330,7 @@ void RouteBase::dumpRouteToKML(const WayptVec& aRoute, const std::string& aName)
   std::fstream f;
   f.open(p.str().c_str(), fstream::out | fstream::app);
   if (!f.is_open()) {
-    SG_LOG(SG_GENERAL, SG_WARN, "unable to open:" << p.str());
+    SG_LOG(SG_NAVAID, SG_WARN, "unable to open:" << p.str());
     return;
   }
   
@@ -376,10 +376,10 @@ void RouteBase::loadAirportProcedures(const SGPath& aPath, FGAirport* aApt)
     NavdataVisitor visitor(aApt, aPath);
     readXML(aPath.str(), visitor);
   } catch (sg_io_exception& ex) {
-    SG_LOG(SG_GENERAL, SG_WARN, "failure parsing procedures: " << aPath.str() <<
+    SG_LOG(SG_NAVAID, SG_WARN, "failure parsing procedures: " << aPath.str() <<
       "\n\t" << ex.getMessage() << "\n\tat:" << ex.getLocation().asString());
   } catch (sg_exception& ex) {
-    SG_LOG(SG_GENERAL, SG_WARN, "failure parsing procedures: " << aPath.str() <<
+    SG_LOG(SG_NAVAID, SG_WARN, "failure parsing procedures: " << aPath.str() <<
       "\n\t" << ex.getMessage());
   }
 }
index 160407528c6fadc75a1ace30098abf996b7df821..6353fb5b678711d5815de93ca7778dd4deb92b6c 100644 (file)
@@ -39,7 +39,7 @@ double pointsKnownDistanceFromGC(const SGGeoc& a, const SGGeoc&b, const SGGeoc&
   double p = atan2(sin(bDist)*cos(A), cos(bDist));
   
   if (sqr(cos(dist)) > sqr(r)) {
-    SG_LOG(SG_GENERAL, SG_INFO, "pointsKnownDistanceFromGC, no points exist");
+    SG_LOG(SG_NAVAID, SG_INFO, "pointsKnownDistanceFromGC, no points exist");
     return -1.0;
   }
   
@@ -256,7 +256,7 @@ bool RoutePath::computedPositionForIndex(int index, SGGeod& r) const
     return true;
   }
   
-  SG_LOG(SG_GENERAL, SG_INFO, "RoutePath::computedPositionForIndex: unhandled type:" << w->type());
+  SG_LOG(SG_NAVAID, SG_INFO, "RoutePath::computedPositionForIndex: unhandled type:" << w->type());
   return false;
 }
 
@@ -287,7 +287,7 @@ double RoutePath::computeAltitudeForIndex(int index) const
   if (!computedPositionForIndex(index, pos) ||
       !computedPositionForIndex(index - 1, prevPos))
   {
-    SG_LOG(SG_GENERAL, SG_WARN, "unable to compute position for waypoints");
+    SG_LOG(SG_NAVAID, SG_WARN, "unable to compute position for waypoints");
     throw sg_range_exception("unable to compute position for waypoints");
   }
   
@@ -325,7 +325,7 @@ double RoutePath::computeTrackForIndex(int index) const
     Hold* h = (Hold*) w.get();
     return h->inboundRadial();
   } else if (w->type() == "vectors") {
-    SG_LOG(SG_GENERAL, SG_WARN, "asked for track from VECTORS");
+    SG_LOG(SG_NAVAID, SG_WARN, "asked for track from VECTORS");
     throw sg_range_exception("asked for track from vectors waypt");
   } else if (w->type() == "runway") {
     FGRunway* rwy = static_cast<RunwayWaypt*>(w.get())->runway();
@@ -338,7 +338,7 @@ double RoutePath::computeTrackForIndex(int index) const
   if (!computedPositionForIndex(index, pos) ||
       !computedPositionForIndex(index - 1, prevPos))
   {
-    SG_LOG(SG_GENERAL, SG_WARN, "unable to compute position for waypoints");
+    SG_LOG(SG_NAVAID, SG_WARN, "unable to compute position for waypoints");
     throw sg_range_exception("unable to compute position for waypoints");
   }
 
index ede0f026d5d6ae8504a028a35d36f06117a1ba4d..81e2c5c8261bd52ac8b563f50aed0665ac442b6f 100644 (file)
@@ -78,7 +78,7 @@ NavaidWaypoint::NavaidWaypoint(FGPositioned* aPos, RouteBase* aOwner) :
   _navaid(aPos)
 {
   if (aPos->type() == FGPositioned::RUNWAY) {
-      SG_LOG(SG_GENERAL, SG_WARN, "sure you don't want to be building a runway waypt here?");
+      SG_LOG(SG_NAVAID, SG_WARN, "sure you don't want to be building a runway waypt here?");
   }
 }
 
index e04f1d8a4a3fcc3a6770eaa518ab56b0d8d741c1..6ca4ed0a60589b0a1e97c27d2bb2935fa859deeb 100644 (file)
@@ -132,7 +132,7 @@ FGScheduledFlight::FGScheduledFlight(const string& cs,
   else
     {
       repeatPeriod = 365*24*60*60;
-      SG_LOG( SG_GENERAL, SG_ALERT, "Unknown repeat period in flight plan "
+      SG_LOG( SG_AI, SG_ALERT, "Unknown repeat period in flight plan "
                                     "of flight '" << cs << "': " << rep );
     }
 
@@ -272,13 +272,13 @@ bool FGScheduledFlight::initializeAirports()
   departurePort = FGAirport::findByIdent(depId);
   if(departurePort == NULL)
     {
-      SG_LOG( SG_GENERAL, SG_DEBUG, "Traffic manager could not find departure airport : " << depId);
+      SG_LOG( SG_AI, SG_DEBUG, "Traffic manager could not find departure airport : " << depId);
       return false;
     }
   arrivalPort = FGAirport::findByIdent(arrId);
   if(arrivalPort == NULL)
     {
-      SG_LOG( SG_GENERAL, SG_DEBUG, "Traffic manager could not find arrival airport   : " << arrId);
+      SG_LOG( SG_AI, SG_DEBUG, "Traffic manager could not find arrival airport   : " << arrId);
       return false;
     }
 
index 49f9331198d58c4d1083000f08ed9dbc3cfe70a6..dd38787ace7fc168c99838a728107299539ab915 100644 (file)
@@ -240,7 +240,7 @@ bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
   // This flight entry is entirely in the past, do we need to 
   // push it forward in time to the next scheduled departure. 
   if (flight->getArrivalTime() < now) {
-    SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager:      Flight is in the Past");
+    SG_LOG (SG_AI, SG_BULK, "Traffic Manager:      Flight is in the Past");
     // Don't just update: check whether we need to load a new leg. etc.
     // This update occurs for distant aircraft, so we can update the current leg
     // and detach it from the current list of aircraft. 
@@ -272,14 +272,14 @@ bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
       
       SGGeodesy::direct(dep->geod(), course, coveredDistance, position, az2);
       
-      SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager:      Flight is in progress, %=" << x);
+      SG_LOG (SG_AI, SG_BULK, "Traffic Manager:      Flight is in progress, %=" << x);
       speed = ((distanceM - coveredDistance) * SG_METER_TO_NM) / 3600.0;
     } else {
     // not departed yet
       //remainingTimeEnroute = totalTimeEnroute;
       elapsedTimeEnroute = 0;
       position = dep->geod();
-      SG_LOG (SG_GENERAL, SG_BULK, "Traffic Manager:      Flight is pending, departure in "
+      SG_LOG (SG_AI, SG_BULK, "Traffic Manager:      Flight is pending, departure in "
         << flight->getDepartureTime() - now << " seconds ");
     }
   } else {
@@ -297,7 +297,7 @@ bool FGAISchedule::update(time_t now, const SGVec3d& userCart)
   // then 500nm, create this flight. At jet speeds 500 nm is roughly
   // one hour flight time, so that would be a good approximate point
   // to start a more detailed simulation of this aircraft.
-  SG_LOG (SG_GENERAL, SG_BULK, "Traffic manager: " << registration << " is scheduled for a flight from " 
+  SG_LOG (SG_AI, SG_BULK, "Traffic manager: " << registration << " is scheduled for a flight from "
             << dep->getId() << " to " << arr->getId() << ". Current distance to user: " 
              << distanceToUser);
   if (distanceToUser >= TRAFFICTOAIDISTTOSTART) {
@@ -323,7 +323,7 @@ bool FGAISchedule::createAIAircraft(FGScheduledFlight* flight, double speedKnots
   FGAirport* dep = flight->getDepartureAirport();
   FGAirport* arr = flight->getArrivalAirport();
   string flightPlanName = dep->getId() + "-" + arr->getId() + ".xml";
-  SG_LOG(SG_GENERAL, SG_INFO, "Traffic manager: Creating AIModel from:" << flightPlanName);
+  SG_LOG(SG_AI, SG_INFO, "Traffic manager: Creating AIModel from:" << flightPlanName);
 
   // Only allow traffic to be created when the model path (or the AI version of mp) exists
   SGPath mp(globals->get_fg_root());
@@ -334,7 +334,7 @@ bool FGAISchedule::createAIAircraft(FGScheduledFlight* flight, double speedKnots
   mp_ai.append(modelPath);
 
   if (!mp.exists() && !mp_ai.exists()) {
-    SG_LOG(SG_GENERAL, SG_WARN, "TrafficManager: Could not load model " << mp_ai.str());
+    SG_LOG(SG_AI, SG_WARN, "TrafficManager: Could not load model " << mp_ai.str());
     return true;
   }
 
@@ -388,7 +388,7 @@ void FGAISchedule::scheduleFlights(time_t now)
   }
   //string startingPort;
   string userPort = fgGetString("/sim/presets/airport-id");
-  SG_LOG(SG_GENERAL, SG_BULK, "Scheduling Flights for : " << modelPath << " " <<  registration << " " << homePort);
+  SG_LOG(SG_AI, SG_BULK, "Scheduling Flights for : " << modelPath << " " <<  registration << " " << homePort);
   FGScheduledFlight *flight = NULL;
   do {
     if (currentDestination.empty()) {
@@ -423,7 +423,7 @@ void FGAISchedule::scheduleFlights(time_t now)
 
     depT = depT.substr(0,24);
     arrT = arrT.substr(0,24);
-    SG_LOG(SG_GENERAL, SG_BULK, "  Flight " << flight->getCallSign() << ":" 
+    SG_LOG(SG_AI, SG_BULK, "  Flight " << flight->getCallSign() << ":" 
                              << "  "        << flight->getDepartureAirport()->getId() << ":"
                              << "  "        << depT << ":"
                              << " \""       << flight->getArrivalAirport()->getId() << "\"" << ":"
@@ -431,7 +431,7 @@ void FGAISchedule::scheduleFlights(time_t now)
   
     flights.push_back(flight);
   } while (currentDestination != homePort);
-  SG_LOG(SG_GENERAL, SG_BULK, " Done ");
+  SG_LOG(SG_AI, SG_BULK, " Done ");
 }
 
 bool FGAISchedule::next()
index ee8e9c64feaec3169fe0cf7c7e17e23c26511d46..2c81a1d30dde30ccde434867204f611a45ceffca 100644 (file)
@@ -307,7 +307,7 @@ void FGTrafficManager::loadHeuristics()
         std::ifstream data(cacheData.c_str());
         data >> revisionStr;
         if (revisionStr != "[TrafficManagerCachedata:ref:2011:09:04]") {
-          SG_LOG(SG_GENERAL, SG_ALERT,"Traffic Manager Warning: discarding outdated cachefile " << 
+          SG_LOG(SG_AI, SG_ALERT,"Traffic Manager Warning: discarding outdated cachefile " <<
                  cacheData.c_str() << " for Airport " << airport);
         } else {
           while (1) {
@@ -317,7 +317,7 @@ void FGTrafficManager::loadHeuristics()
               break;
             HeuristicMapIterator itr = heurMap.find(h.registration);
             if (itr != heurMap.end()) {
-              SG_LOG(SG_GENERAL, SG_WARN,"Traffic Manager Warning: found duplicate tailnumber " << 
+              SG_LOG(SG_AI, SG_WARN,"Traffic Manager Warning: found duplicate tailnumber " <<
                      h.registration << " for AI aircraft");
             } else {
               heurMap[h.registration] = h;
@@ -450,7 +450,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
          if (!tokens.empty()) {
              if (tokens[0] == string("AC")) {
                  if (tokens.size() != 13) {
-                     SG_LOG(SG_GENERAL, SG_ALERT, "Error parsing traffic file " << infileName.str() << " at " << buffString);
+                     SG_LOG(SG_AI, SG_ALERT, "Error parsing traffic file " << infileName.str() << " at " << buffString);
                      exit(1);
                  }
                  model          = tokens[12];
@@ -471,11 +471,11 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
                  offset         = atof(tokens[7].c_str());;
                  
                  if (!FGAISchedule::validModelPath(model)) {
-                     SG_LOG(SG_GENERAL, SG_WARN, "TrafficMgr: Missing model path:" << 
+                     SG_LOG(SG_AI, SG_WARN, "TrafficMgr: Missing model path:" <<
                             model << " from " << infileName.str());
                  } else {
                  
-                 SG_LOG(SG_GENERAL, SG_INFO, "Adding Aircraft" << model << " " << livery << " " << homePort << " " 
+                 SG_LOG(SG_AI, SG_INFO, "Adding Aircraft" << model << " " << livery << " " << homePort << " "
                                                                 << registration << " " << flightReq << " " << isHeavy 
                                                                 << " " << acType << " " << airline << " " << m_class 
                                                                 << " " << FlightType << " " << radius << " " << offset);
@@ -496,7 +496,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
              if (tokens[0] == string("FLIGHT")) {
                  //cerr << "Found flight " << buffString << " size is : " << tokens.size() << endl;
                  if (tokens.size() != 10) {
-                     SG_LOG(SG_GENERAL, SG_ALERT, "Error parsing traffic file " << infileName.str() << " at " << buffString);
+                     SG_LOG(SG_AI, SG_ALERT, "Error parsing traffic file " << infileName.str() << " at " << buffString);
                      exit(1);
                  }
                  string callsign = tokens[1];
@@ -511,7 +511,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
                  string requiredAircraft = tokens[9];
 
                  if (weekdays.size() != 7) {
-                     SG_LOG(SG_GENERAL, SG_ALERT, "Found misconfigured weekdays string" << weekdays);
+                     SG_LOG(SG_AI, SG_ALERT, "Found misconfigured weekdays string" << weekdays);
                      exit(1);
                  }
                  depTime.clear();
@@ -543,7 +543,7 @@ void FGTrafficManager::readTimeTableFromFile(SGPath infileName)
                              snprintf(buffer, 4, "%d/", 0);
                              arrivalTime   = string(buffer) + arrTimeGen  + string(":00");
                          }
-                         SG_LOG(SG_GENERAL, SG_ALERT, "Adding flight " << callsign       << " "
+                         SG_LOG(SG_AI, SG_ALERT, "Adding flight " << callsign       << " "
                                                       << fltrules       << " "
                                                       <<  departurePort << " "
                                                       <<  arrivalPort   << " "
@@ -699,7 +699,7 @@ void FGTrafficManager::endElement(const char *name)
             snprintf(buffer, 16, "%d", acCounter);
             requiredAircraft = buffer;
         }
-        SG_LOG(SG_GENERAL, SG_DEBUG, "Adding flight: " << callsign << " "
+        SG_LOG(SG_AI, SG_DEBUG, "Adding flight: " << callsign << " "
                << fltrules << " "
                << departurePort << " "
                << arrivalPort << " "
@@ -709,7 +709,7 @@ void FGTrafficManager::endElement(const char *name)
         // For database maintainance purposes, it may be convenient to
         // 
         if (fgGetBool("/sim/traffic-manager/dumpdata") == true) {
-             SG_LOG(SG_GENERAL, SG_ALERT, "Traffic Dump FLIGHT," << callsign << ","
+             SG_LOG(SG_AI, SG_ALERT, "Traffic Dump FLIGHT," << callsign << ","
                           << fltrules << ","
                           << departurePort << ","
                           << arrivalPort << ","
@@ -746,7 +746,7 @@ void FGTrafficManager::endAircraft()
     
     if (!FGAISchedule::validModelPath(mdl)) {
         missingModels.insert(mdl);
-        SG_LOG(SG_GENERAL, SG_WARN, "TrafficMgr: Missing model path:" << mdl);
+        SG_LOG(SG_AI, SG_WARN, "TrafficMgr: Missing model path:" << mdl);
         requiredAircraft = homePort = "";
         return;
     }
@@ -760,7 +760,7 @@ void FGTrafficManager::endAircraft()
     }
     
     if (fgGetBool("/sim/traffic-manager/dumpdata") == true) {
-        SG_LOG(SG_GENERAL, SG_ALERT, "Traffic Dump AC," << homePort << "," << registration << "," << requiredAircraft 
+        SG_LOG(SG_AI, SG_ALERT, "Traffic Dump AC," << homePort << "," << registration << "," << requiredAircraft
                << "," << acType << "," << livery << "," 
                << airline << ","  << m_class << "," << offset << "," << radius << "," << flighttype << "," << isHeavy << "," << mdl);
     }