]> git.mxchange.org Git - flightgear.git/commitdiff
Dump more config state at startup.
authorJames Turner <zakalawe@mac.com>
Fri, 8 Feb 2013 13:15:20 +0000 (13:15 +0000)
committerJames Turner <zakalawe@mac.com>
Fri, 8 Feb 2013 13:15:20 +0000 (13:15 +0000)
Ensure that log files capture enough config state to debug path/search issues. Easy to expand this mechanism now to record anything similar.

src/Main/fg_init.cxx
src/Main/fg_init.hxx
src/Main/main.cxx

index 5e91d5ec94d036be92ec91389227304eb64919d7..12c0381517cade177c594b530ad5dd0c6b5285e9 100644 (file)
@@ -527,6 +527,20 @@ bool fgInitGeneral() {
     return true;
 }
 
+// Write various configuraton values out to the logs
+void fgOutputSettings()
+{    
+    SG_LOG( SG_GENERAL, SG_INFO, "Configuration State" );
+    SG_LOG( SG_GENERAL, SG_INFO, "======= ==============" );
+    
+    SG_LOG( SG_GENERAL, SG_INFO, "aircraft-dir = " << '"' << fgGetString("/sim/aircraft-dir") << '"' );
+    SG_LOG( SG_GENERAL, SG_INFO, "fghome-dir = " << '"' << globals->get_fg_home() << '"');
+    SG_LOG( SG_GENERAL, SG_INFO, "aircraft-dir = " << '"' << fgGetString("/sim/aircraft-dir") << '"');
+    
+    SG_LOG( SG_GENERAL, SG_INFO, "aircraft-search-paths = \n\t" << simgear::strutils::join(globals->get_aircraft_paths(), "\n\t") );
+    SG_LOG( SG_GENERAL, SG_INFO, "scenary-search-paths = \n\t" << simgear::strutils::join(globals->get_fg_scenery(), "\n\t") );
+}
+
 // This is the top level init routine which calls all the other
 // initialization routines.  If you are adding a subsystem to flight
 // gear, its initialization call should located in this routine.
index f79a6f5313fc5f69872a2a477ef9e1d4912580e4..b6f7ce2b1dbb763768d1964d5d8e1f5c7fa92471 100644 (file)
@@ -40,6 +40,9 @@ void fgInitHome();
 bool fgInitConfig ( int argc, char **argv );
 
 
+// log various settings / configuration state
+void fgOutputSettings();
+
 // Initialize the localization
 SGPropertyNode *fgInitLocale(const char *language);
 
index 1f885e7c26fb21517dc9beb050c6ecc1d55b6485..ebb72641a95eb6d2dd220dd2dd4c6fc9b6a8ddde 100644 (file)
@@ -357,6 +357,8 @@ int fgMainInit( int argc, char **argv ) {
         ATIScreenSizeHack();
     }
     
+    fgOutputSettings();
+    
     // pass control off to the master event handler
     int result = fgOSMainLoop();