I've today added a new debugging tool in Nasal: debug.proptrace().
It lists every node creation or deletion, and every write access
to a property node to the console (except direct writes to tied
properties). The output is by default colored like almost
every output from the debug.nas module. To change that, use
--prop:sim/startup/terminal-ansi-colors=0

The function traces by default the *whole* tree for one
second. With debug.proptrace() you get something like this:

  ...
  SET /environment/current-tile-id = 942050 (INT)
  SET /environment/atmosphere/altitude-troposphere-top = 12997.65078857355 
(DOUBLE, T)
  SET /environment/atmosphere/altitude-half-to-sun = 6498.031123964116 (DOUBLE, 
T)
  -------------------- FRAME --------------------
  SET /sim/signals/frame = 1 (BOOL, L1)
  SET /sim/time/delta-realtime-sec = 0.6916666666666666 (DOUBLE)
  SET /sim/time/delta-sec = 0.6916666666666666 (DOUBLE)
  SET /systems/refuel/contact = 0 (BOOL)
  ...

where the FRAME line marks the begin of a frame. You can also
select just a subtree, and let it be traced for an arbitrary
time:   debug.proptrace("/sim/model", 10);  # 10 seconds

The output will also contain lines like the following when
properties are generated or removed:

  ADD /sim/model/foo
  DEL /sim/model/foo

People may want to use this function to check how often properties
with attached listeners are written to. These contain an L[0-9]+
statement in the attribute part:  (BOOL, L1)  means that it's a
boolean property with one attached listener. The proptrace()
function works itself with listeners, hence the "Extreme Listening"
in the title.  :-)

m.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to