Difference between revisions of "Commonly used debugging tools"

From FlightGear wiki
Jump to: navigation, search
(fgfs.log)
(Minor copy editing; +-heading levels; +- Updating link to debug level source file and making it a footnote; +- Minor rewrite of the fgfs.log section; +Reference section)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{stub}}
 
{{stub}}
 
  
 
There are some relatively simple but '''commonly used debugging tools''' that might answer questions of for example why your installation of FlightGear will not run properly or at all, why an aircraft might have problems or why flying in a certain area always cause FlightGear crashes.
 
There are some relatively simple but '''commonly used debugging tools''' that might answer questions of for example why your installation of FlightGear will not run properly or at all, why an aircraft might have problems or why flying in a certain area always cause FlightGear crashes.
  
The more useful of those tool are the console window (also known as the "black box" or confusingly the "command line"), the <code>fgfs.log</code> file and the property browser.
+
The more useful of those tools are the console window (also known as the "black box" or confusingly the "command line"), the <code>fgfs.log</code> file and the property browser.
  
 
There are of course times when these will not do, and sometimes one would have to compile FlightGear from source ''and'' add some additional debugging features to find some bugs.
 
There are of course times when these will not do, and sometimes one would have to compile FlightGear from source ''and'' add some additional debugging features to find some bugs.
  
== Debug level setting ==
+
== Console and startup log output ==
 +
=== Debug levels ===
 
Before we go any further we should mention the ''debug level'' setting (also known as ''log level'').  When FlightGear runs it will output information on various things.  As a default only things that are expected to cause troubles are output, but by setting a higher debug level more information will be shown.  At the highest debug level one can expect FlightGear to run slow due to all the debug output.
 
Before we go any further we should mention the ''debug level'' setting (also known as ''log level'').  When FlightGear runs it will output information on various things.  As a default only things that are expected to cause troubles are output, but by setting a higher debug level more information will be shown.  At the highest debug level one can expect FlightGear to run slow due to all the debug output.
  
=== Debug levels ===
+
There are five debug levels:<ref>That are relevant for the console window and log file. See {{simgear source |path=/simgear/debug/debug_types.h |commit=2ab0122124169b0d6ac900423e76d2437ed22e98 |line=47}}.</ref>
There are five debug levels:
+
 
; Bulk:  Will output very frequent messages.  Using this setting might slow down FlightGear a lot, but might show problems not otherwise found.
 
; Bulk:  Will output very frequent messages.  Using this setting might slow down FlightGear a lot, but might show problems not otherwise found.
 
; Debug:  Will output less frequent debug messages.
 
; Debug:  Will output less frequent debug messages.
Line 19: Line 18:
 
; Alert:  Will output messages about very possibly impeding problems.  This is the default level.
 
; Alert:  Will output messages about very possibly impeding problems.  This is the default level.
  
=== Setting the debug level ===
+
==== Setting the debug level ====
==== FGRun ====
+
===== FGRun =====
 
In FGRun go to the last page click {{key press|Advanced...}} then, in the list to the left, click "Debug" and then chose the desired debug level in the list.
 
In FGRun go to the last page click {{key press|Advanced...}} then, in the list to the left, click "Debug" and then chose the desired debug level in the list.
  
==== Command line ====
+
===== Command line =====
 
{{note|Debug levels must be lowercase.  For example <code>debug</code>, not <code><s>&ensp;Debug&ensp;</s></code>.}}
 
{{note|Debug levels must be lowercase.  For example <code>debug</code>, not <code><s>&ensp;Debug&ensp;</s></code>.}}
  
 
Add <code>--log-level=''debug level''</code> to your command line.
 
Add <code>--log-level=''debug level''</code> to your command line.
  
== The console window ==
+
=== The console window ===
 
Before FlightGear 2.6 this was always opened in a separate window when starting FlightGear through the [[FGRun]] wizard, but these days it is normally hidden and can be shown by ticking a checkbox, "Show command line".
 
Before FlightGear 2.6 this was always opened in a separate window when starting FlightGear through the [[FGRun]] wizard, but these days it is normally hidden and can be shown by ticking a checkbox, "Show command line".
  
== fgfs.log ==
+
=== fgfs.log ===
 
The startup log file contains nearly the same information that is output on the console.
 
The startup log file contains nearly the same information that is output on the console.
  
The goal of adding the log file was to capture some debugging output in a way that is robust for users, i.e just works, and works ‘historically’, i.e is useful when a problem occurs since it was already enabled. The level is fixed at INFO because a lower level wouldn’t contain enough detail for debugging, but a higher level (SG_DEBUG) the files would be huge for a long FG session. This is my decision of course and it can be changed if people are happy with 100MB+ text files in their FG_HOME. Or we add a new option to set the file-log-level, but again the intention was for this feature to be as automatic as possible.<ref>{{cite web
+
The purpose of the log file is to capture debugging output in a way that is robust for users, in essence that just work, and that capture errors that happen. That is in essence useful when a problem occur since it was already enabled.
 +
 
 +
The level defaults to ''info'' because a lower level would not contain enough detail for debugging, but a higher level, for example ''debug'', the files would be huge for a long FlightGear session. This can of course be changed if people are happy with text files bigger than 100 MB in their [[$FG_HOME]]. Or we add a new option to set the file-log-level, but again the intention was for this feature to be as automatic as possible.<ref>{{cite web
 
   |url    =  https://sourceforge.net/p/flightgear/mailman/message/35144644/  
 
   |url    =  https://sourceforge.net/p/flightgear/mailman/message/35144644/  
 
   |title  =  <nowiki> Re: [Flightgear-devel] fgfs.log </nowiki>  
 
   |title  =  <nowiki> Re: [Flightgear-devel] fgfs.log </nowiki>  
Line 43: Line 44:
 
   }}</ref>
 
   }}</ref>
  
 
+
==== Finding fgfs.log ====
=== Finding fgfs.log ===
+
Navigate to [[$FG_HOME]]
+
 
; Mac:      <code>~/Library/Application Support/FlightGear/fgfs.log</code>
 
; Mac:      <code>~/Library/Application Support/FlightGear/fgfs.log</code>
 
; Windows:  <code>C:\Users\''user name''\AppData\Roaming\flightgear.org\fgfs.log</code>
 
; Windows:  <code>C:\Users\''user name''\AppData\Roaming\flightgear.org\fgfs.log</code>
Line 53: Line 52:
 
{{main article|Property browser}}
 
{{main article|Property browser}}
 
The property browser is a tool useful for many purposes.  It might for example tell if a property is tied and can not be written to.
 
The property browser is a tool useful for many purposes.  It might for example tell if a property is tied and can not be written to.
 +
 +
== References ==
 +
<references/>
  
 
== Related content ==
 
== Related content ==
 +
=== Wiki articles ===
 
* [[Command line]]
 
* [[Command line]]
 
* [[Property browser]]
 
* [[Property browser]]
 
* [[Howto:Understand console output]]
 
* [[Howto:Understand console output]]
 
* [[:Category:Troubleshooting]]
 
* [[:Category:Troubleshooting]]
 
== External links ==
 
* [https://gitorious.org:443/fg/simgear/source/deceee899771b82b0568319863b3812b272c926d:simgear/debug/debug_types.h#L44 The debug levels as mentioned in the source code]
 
  
 
[[Category:Troubleshooting]]
 
[[Category:Troubleshooting]]
 
[[Category:Aircraft enhancement]]
 
[[Category:Aircraft enhancement]]

Latest revision as of 16:49, 15 April 2020

This article is a stub. You can help the wiki by expanding it.

There are some relatively simple but commonly used debugging tools that might answer questions of for example why your installation of FlightGear will not run properly or at all, why an aircraft might have problems or why flying in a certain area always cause FlightGear crashes.

The more useful of those tools are the console window (also known as the "black box" or confusingly the "command line"), the fgfs.log file and the property browser.

There are of course times when these will not do, and sometimes one would have to compile FlightGear from source and add some additional debugging features to find some bugs.

Console and startup log output

Debug levels

Before we go any further we should mention the debug level setting (also known as log level). When FlightGear runs it will output information on various things. As a default only things that are expected to cause troubles are output, but by setting a higher debug level more information will be shown. At the highest debug level one can expect FlightGear to run slow due to all the debug output.

There are five debug levels:[1]

Bulk
Will output very frequent messages. Using this setting might slow down FlightGear a lot, but might show problems not otherwise found.
Debug
Will output less frequent debug messages.
Info
Will output informatory messages.
Warn
Will output messages about possibly impeding problems.
Alert
Will output messages about very possibly impeding problems. This is the default level.

Setting the debug level

FGRun

In FGRun go to the last page click Advanced... then, in the list to the left, click "Debug" and then chose the desired debug level in the list.

Command line
Note  Debug levels must be lowercase. For example debug, not  Debug .

Add --log-level=debug level to your command line.

The console window

Before FlightGear 2.6 this was always opened in a separate window when starting FlightGear through the FGRun wizard, but these days it is normally hidden and can be shown by ticking a checkbox, "Show command line".

fgfs.log

The startup log file contains nearly the same information that is output on the console.

The purpose of the log file is to capture debugging output in a way that is robust for users, in essence that just work, and that capture errors that happen. That is in essence useful when a problem occur since it was already enabled.

The level defaults to info because a lower level would not contain enough detail for debugging, but a higher level, for example debug, the files would be huge for a long FlightGear session. This can of course be changed if people are happy with text files bigger than 100 MB in their $FG_HOME. Or we add a new option to set the file-log-level, but again the intention was for this feature to be as automatic as possible.[2]

Finding fgfs.log

Mac
~/Library/Application Support/FlightGear/fgfs.log
Windows
C:\Users\user name\AppData\Roaming\flightgear.org\fgfs.log
Linux
~/.fgfs/fgfs.log

The property browser

1rightarrow.png See Property browser for the main article about this subject.

The property browser is a tool useful for many purposes. It might for example tell if a property is tied and can not be written to.

References

  1. That are relevant for the console window and log file. See flightgear/simgear/2ab0122124169b0d6ac900423e76d2437ed22e98//simgear/debug/debug_types.h#l47.
  2. James Turner  (Jun 8th, 2016).  Re: [Flightgear-devel] fgfs.log .

Related content

Wiki articles