SG_LOG is a wrapper macro for the SimGear
logstream class. By default, the
logstream class writes all output to the console.
SG_LOG simplifies debugging for core developers who regularly compile from source. It allows you to easily associate your debug messages with a "channel" and with a "priority". This mechanism allows users to explicitly enable to certain log messages, while ignoring others. This can be helpful in order to troubleshoot certain problems.
Logging settings can be modified using the
--log-class=[class] command line options. Where
level is one of the following:
class is a white space seperated list of any (combination) of the following:
For a complete list of available classes, see simgear/simgear/debug/debug_types.h.
Log output will be prefixed with
<filename>:<line>: if Flightgear is started with command-line option
Text output from Nasal will be prefixed with
<nasal-filename>:<line>: if Flightgear is started with command-line option
On can modify log levels based on the file/function-name/line-number of calls to
SG_LOG(), by setting the environmental variable
SG_LOG_DELTAS when running Flightgear.
For example one can increase debugging diagnostics from scenery paging code with:
SG_LOG_DELTAS=flightgear/src/Scenery/SceneryPager.cxx=+3 fgfs.exe ...
For details see: simgear/simgear/debug/logdelta.hxx.