Logging properties: Difference between revisions
Jump to navigation
Jump to search
(→Readme files: Template:Readme file) |
No edit summary |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{about|logging properties|logging errors|Commonly used debugging tools#fgfs.log}} | |||
{{Template:PropertyTree}} | {{Template:PropertyTree}} | ||
__NOTOC__ | __NOTOC__ | ||
FlightGear has the ability to produce multiple files '''logging properties'''. Both the properties and the interval between the records are user selectable. | FlightGear has the ability to produce multiple files '''logging properties'''. Both the properties and the interval between the records are user selectable. | ||
Line 13: | Line 16: | ||
<logging> | <logging> | ||
<log> | <log> | ||
<filename>steering.csv</filename> | <filename>/home/{your-user-name}/.fgfs/Export/steering.csv</filename> | ||
<enabled>true</enabled> | <enabled>true</enabled> | ||
<interval-ms>1000</interval-ms> | <interval-ms>1000</interval-ms> | ||
<delimiter>,</delimiter> | <delimiter>,</delimiter> | ||
<entry> | <entry> | ||
<enabled>true</enabled> | |||
<title>Rudder</title> | <title>Rudder</title> | ||
<property>/controls/rudder</property> | <property>/controls/rudder</property> | ||
</entry> | </entry> | ||
<entry> | <entry> | ||
<enabled>true</enabled><ref></ref> | |||
<title>Ailerons</title> | <title>Ailerons</title> | ||
<property>/controls/aileron</property> | <property>/controls/aileron</property> | ||
Line 51: | Line 56: | ||
22097,-0.000000,-0.168000 | 22097,-0.000000,-0.168000 | ||
</pre> | </pre> | ||
The easiest way for an end-user to define logs is to put the log configuration in an XML file (usually under the [[$FG_HOME]] directory), then refer to it using the --config option, like | |||
<pre>fgfs --config=log-config.xml</pre> | |||
This option can be passed via the command line or in the options settings of your favourite launcher. | |||
== Related content == | == Related content == | ||
=== Wiki articles === | === Wiki articles === | ||
* [[Generic protocol]] – ''Alternative and more flexible way to log or even stream data.'' | * [[Generic protocol]] – ''Alternative and more flexible way to log or even stream data.'' | ||
* [[Interfacing FlightGear]] | |||
* [[JSBSim Logging]] - ''Alternative way to log if the aircraft is JSBSim based.'' | |||
* [[Howto:Record, analyze and replay multiplayer flights with network tools]] - ''Logging the network traffic between your computer and a multiplayer server.'' | |||
=== Readme files === | === Readme files === | ||
Line 60: | Line 74: | ||
=== Source code === | === Source code === | ||
* {{ | * {{flightgear file|src/Main/logger.hxx}} | ||
* {{ | * {{flightgear file|src/Main/logger.cxx}} | ||
[[Category:Property Tree]] | [[Category:Property Tree]] |
Latest revision as of 01:13, 9 March 2024
This article is about logging properties. For logging errors, see Commonly used debugging tools#fgfs.log.
FlightGear has the ability to produce multiple files logging properties. Both the properties and the interval between the records are user selectable.
More than one log file can be configured in the PropertyList file setting up what properties to log.
Simple example
Here is a simple example that logs the rudder and aileron positions to the file steering.csv
every second or so:
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<logging>
<log>
<filename>/home/{your-user-name}/.fgfs/Export/steering.csv</filename>
<enabled>true</enabled>
<interval-ms>1000</interval-ms>
<delimiter>,</delimiter>
<entry>
<enabled>true</enabled>
<title>Rudder</title>
<property>/controls/rudder</property>
</entry>
<entry>
<enabled>true</enabled><ref></ref>
<title>Ailerons</title>
<property>/controls/aileron</property>
</entry>
</log>
</logging>
</PropertyList>
Here is some sample output:
Time,Rudder,Ailerons 6522,0.000000,0.000000 7668,-0.000000,0.000000 8702,-0.000000,0.000000 9705,-0.000000,0.000000 10784,-0.000000,0.000000 11792,-0.000000,0.000000 12808,-0.000000,-0.210000 13826,-0.000000,-0.344000 14881,-0.000000,-0.066000 15901,-0.000000,-0.806000 16943,-0.000000,-0.936000 17965,-0.000000,-0.534000 19013,-0.000000,-0.294000 20044,-0.000000,0.270000 21090,-0.000000,-1.000000 22097,-0.000000,-0.168000
The easiest way for an end-user to define logs is to put the log configuration in an XML file (usually under the $FG_HOME directory), then refer to it using the --config option, like
fgfs --config=log-config.xml
This option can be passed via the command line or in the options settings of your favourite launcher.
Related content
Wiki articles
- Generic protocol – Alternative and more flexible way to log or even stream data.
- Interfacing FlightGear
- JSBSim Logging - Alternative way to log if the aircraft is JSBSim based.
- Howto:Record, analyze and replay multiplayer flights with network tools - Logging the network traffic between your computer and a multiplayer server.
Readme files
- $FG_ROOT/Docs/README.logging