]> git.mxchange.org Git - flightgear.git/commitdiff
FlightRecorder: smarter log warning.
authorJames Turner <zakalawe@mac.com>
Sun, 10 Feb 2013 11:47:16 +0000 (11:47 +0000)
committerJames Turner <zakalawe@mac.com>
Sun, 10 Feb 2013 11:47:16 +0000 (11:47 +0000)
When using the default (generic) config, which references many props which may not exist in a particular aircraft, suppress the 'recording non-existent' property warning.

src/Aircraft/flightrecorder.cxx
src/Aircraft/flightrecorder.hxx

index 5e37b2c3686847ad4d266acc225e6750193f4d3d..34a03c18d323a085bc854ccb2b281ee209aaaba0 100644 (file)
@@ -43,7 +43,8 @@ using std::string;
 FGFlightRecorder::FGFlightRecorder(const char* pConfigName) :
     m_RecorderNode(fgGetNode("/sim/flight-recorder", true)),
     m_TotalRecordSize(0),
-    m_ConfigName(pConfigName)
+    m_ConfigName(pConfigName),
+    m_usingDefaultConfig(false)
 {
 }
 
@@ -55,6 +56,7 @@ void
 FGFlightRecorder::reinit(void)
 {
     m_ConfigNode = 0;
+    m_usingDefaultConfig = false;
 
     SGPropertyNode_ptr ConfigNode;
     int Selected = m_RecorderNode->getIntValue(m_ConfigName, 0);
@@ -188,6 +190,7 @@ FGFlightRecorder::getDefault(void)
         }
     }
 
+    m_usingDefaultConfig = true;
     return ConfigNode;
 }
 
@@ -254,9 +257,15 @@ FGFlightRecorder::processSignalList(const char* pSignalType, TSignalList& Signal
                     Capture.Signal = fgGetNode(PPath.c_str(),false);
                     if (!Capture.Signal.valid())
                     {
-                        // warn user: we're maybe going to record useless data
-                        // Or maybe the data is only initialized later. Warn anyway, so we can catch useless data. 
-                        SG_LOG(SG_SYSTEMS, SG_INFO, "FlightRecorder: Recording non-existent property '" << PPath << "'.");
+                        // JMT - only warn if using a custom config, not the default one. Since the generic config of
+                        // course requests many props, but we do want this warning for custom configs tailored to the
+                        // aircraft model.
+                        if (!m_usingDefaultConfig) {
+                            // warn user: we're maybe going to record useless data
+                            // Or maybe the data is only initialized later. Warn anyway, so we can catch useless data.
+                            SG_LOG(SG_SYSTEMS, SG_INFO, "FlightRecorder: Recording non-existent property '" << PPath << "'.");
+                        }
+                        
                         Capture.Signal = fgGetNode(PPath.c_str(),true);
                     }
 
index 3fddc11b306040c66a146ea3c215591beed04a30..f3759df64acc026be5a89012fb27dd83a1de971b 100644 (file)
@@ -88,6 +88,7 @@ private:
 
     int m_TotalRecordSize;
     std::string m_ConfigName;
+    bool m_usingDefaultConfig;
 };
 
 #endif /* FLIGHTRECORDER_HXX_ */