diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 578e2a2a6..536fee391 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -503,11 +503,28 @@ static naRef f_setprop(naContext c, naRef me, int argc, naRef* args) return naNum(result); } + +struct SimNasalLogFileLine : SGPropertyChangeListener +{ + SimNasalLogFileLine() { + SGPropertyNode* node = fgGetNode("/sim/nasal-log-file-line", true /*create*/); + node->addChangeListener(this, true /*initial*/); + } + virtual void valueChanged(SGPropertyNode* node) { + _file_line = node->getIntValue(); + } + + static bool _file_line; +}; + +bool SimNasalLogFileLine::_file_line = false; + // print() extension function. Concatenates and prints its arguments // to the FlightGear log. Uses the highest log level (SG_ALERT), to // make sure it appears. Is there better way to do this? static naRef f_print(naContext c, naRef me, int argc, naRef* args) { + static SimNasalLogFileLine snlfl; string buf; int n = argc; for(int i=0; i