SG LOG: Difference between revisions

Jump to navigation Jump to search
848 bytes added ,  6 October 2021
Added info about file/line numbers in logging, and SG_LOG_DELTAS.
(Minor changes; +related: Commonly used debugging tools#Console and startup log output)
(Added info about file/line numbers in logging, and SG_LOG_DELTAS.)
Line 19: Line 19:


If you are interested in simply logging certain properties to a file at runtime, you can use either FlightGear's built-in [[Logging properties|logging framework]], or the [[generic protocol]].
If you are interested in simply logging certain properties to a file at runtime, you can use either FlightGear's built-in [[Logging properties|logging framework]], or the [[generic protocol]].
== File/line numbers ==
Log output will be prefixed with <code>&lt;filename&gt;:&lt;line&gt;:</code> if Flightgear is started with command-line option <code>--prop:bool:/sim/log-file-line=true</code>.
Text output from Nasal will be prefixed with <code>&lt;nasal-filename&gt;:&lt;line&gt;:</code> if Flightgear is started with command-line option <code>--prop:bool:/sim/nasal-log-file-line=true</code>.
== Log deltas ==
On can modify log levels based on the file/function-name/line-number of calls to <code>SG_LOG()</code>, by setting the environmental variable <code>SG_LOG_DELTAS</code> when running Flightgear.
For example one can increase debugging diagnostics from scenery paging code with:
<code>SG_LOG_DELTAS=flightgear/src/Scenery/SceneryPager.cxx=+3 fgfs.exe ...</code>
For details see: {{simgear file|simgear/debug/logdelta.hxx}}.


== Related content ==
== Related content ==
219

edits

Navigation menu