Debian Codegraph @

Docs/README.logging

raw
1 Logging in FlightGear
2 ---------------------
3
4 [Note: JSBSim also has its own independent logging facilities, which
5 are not discussed here.]
6
7 FlightGear can log any property values at any interval to one or more
8 CSV files (which can be read and graphed using spreadsheets like
9 Gnumeric or Excel). Logging is defined in the '/logging' subbranch of
10 the main property tree; under '/logging', each '/log' subbranch
11 defines a separate log with its own output file and interval. Here is
12 a simple example that logs the rudder and aileron settings every
13 second (1000ms) to the file steering.csv, using a comma (the default,
14 anyway) as the field delimiter:
15
16 <PropertyList>
17 <logging>
18 <log>
19 <enabled>true</enabled>
20 <filename>steering.csv</filename>
21 <interval-ms>1000</interval-ms>
22 <delimiter>,</delimiter>
23 <entry>
24 <enabled>true</enabled>
25 <title>Rudder</title>
26 <property>/controls/flight/rudder</property>
27 </entry>
28 <entry>
29 <enabled>true</enabled>
30 <title>Ailerons</title>
31 <property>/controls/flight/aileron</property>
32 </entry>
33 </log>
34 </logging>
35 </PropertyList>
36
37 Each 'log' subbranch contains a required 'enabled' property, an
38 optional 'filename' property (defaults to "fg_log.csv"), an optional
39 'delimiter' property (defaults to a comma), an optional 'interval-ms'
40 property (defaults to 0, which logs every frame), and a series of
41 'entry' subbranches. The 'delimiter' property uses only the first
42 character of the property value as the delimiter. Note that the
43 logger does no escaping, so you must choose a delimiter that will not
44 appear in the property values (that's not hard, since most of the
45 values are numeric, but watch for commas in the titles).
46
47 Each 'entry' subbranch contains a required 'enabled' property, a
48 'property' property specifying the name of the property to be logged,
49 and an optional 'title' property specifying the title to use in the
50 CSV file (defaults to the full path of the property). The elapsed
51 time in milliseconds since the start of the simulation is always
52 included as the first entry with the title "Time", so there is no need
53 to include it explicitly.
54
55 Here's a sample of the logging output for the above log:
56
57 Time,Rudder,Ailerons
58 6522,0.000000,0.000000
59 7668,-0.000000,0.000000
60 8702,-0.000000,0.000000
61 9705,-0.000000,0.000000
62 10784,-0.000000,0.000000
63 11792,-0.000000,0.000000
64 12808,-0.000000,-0.210000
65 13826,-0.000000,-0.344000
66 14881,-0.000000,-0.066000
67 15901,-0.000000,-0.806000
68 16943,-0.000000,-0.936000
69 17965,-0.000000,-0.534000
70 19013,-0.000000,-0.294000
71 20044,-0.000000,0.270000
72 21090,-0.000000,-1.000000
73 22097,-0.000000,-0.168000
74
75 Note that the requested interval is only a minimum; most of the time,
76 the actual interval is slightly longer than the requested one.
77
78 The easiest way for an end-user to define logs is to put the log in a
79 separate XML file (usually under the user's home directory), then
80 refer to it using the --config option, like this:
81
82 fgfs --config=log-config.xml
83
84 The output log files are always relative to the current directory.
85
86 --
87
88 David Megginson, last updated 2002-02-01