Difference between revisions of "SG LOG"

From FlightGear wiki
Jump to: navigation, search
(Merge from SG_LOG() and cleanup)
(Minor changes; +related: Commonly used debugging tools#Console and startup log output)
 
Line 9: Line 9:
 
* <code>alert</code>
 
* <code>alert</code>
 
* <code>popup</code>
 
* <code>popup</code>
And <code>class</code> is a white space seperate list of any (combination) of the following:
+
And <code>class</code> is a white space seperated list of any (combination) of the following:
 
* <code>all</code>
 
* <code>all</code>
 
* <code>ai</code>
 
* <code>ai</code>
 
* <code>enviroment</code>
 
* <code>enviroment</code>
 
* <code>flight</code>
 
* <code>flight</code>
* etc. See {{simgear file|simgear/debug/debug_types.h}} for the complete list of available classes.
+
* etc.
 +
 
 +
For a complete list of available classes, see {{simgear file|simgear/debug/debug_types.h}}.
  
 
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]].
  
 
== Related content ==
 
== Related content ==
 +
=== Wiki articles ===
 
* [[Command line options#Debugging Options]]
 
* [[Command line options#Debugging Options]]
 +
* [[Commonly used debugging tools#Console and startup log output]]
  
== External links ==
+
=== Source code ===
=== Source files ===
+
 
* {{simgear file|simgear/debug/logstream.cxx}}
 
* {{simgear file|simgear/debug/logstream.cxx}}
 
* {{simgear file|simgear/debug/logstream.hxx}}
 
* {{simgear file|simgear/debug/logstream.hxx}}

Latest revision as of 03:33, 27 September 2020

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.

Usage

Logging settings can be modified using the --log-level=[level] and --log-class=[class] command line options. Where level is one of the following:

  • bulk
  • debug
  • info
  • warn
  • alert
  • popup

And class is a white space seperated list of any (combination) of the following:

  • all
  • ai
  • enviroment
  • flight
  • etc.

For a complete list of available classes, see simgear/simgear/debug/debug_types.h.

If you are interested in simply logging certain properties to a file at runtime, you can use either FlightGear's built-in logging framework, or the generic protocol.

Related content

Wiki articles

Source code