SG LOG: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Cleanup)
(Merge from SG_LOG() and cleanup)
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{merge|SG_LOG()}}
<code>SG_LOG</code> is a wrapper macro for the [[SimGear]] <code>logstream</code> class.  By default, the <code>logstream</code> class writes all output to the [[console]].  <code>SG_LOG</code> simplifies debugging for core developers who regularly [[Building FlightGear|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.


<code>SG_LOG</code> is a wrapper macro for the [[SimGear]] <code>logstream</code> class.  By default, the <code>logstream</code> class writes all output to the console.  <code>SG_LOG</code> simplifies debugging for core developers who regularly [[Building FlightGear|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 <code>--log-level=[level]</code> and <code>--log-class=[class]</code> [[command line]] options. Where <code>level</code> is one of the following:
* <code>bulk</code>
* <code>debug</code>
* <code>info</code>
* <code>warn</code>
* <code>alert</code>
* <code>popup</code>
And <code>class</code> is a white space seperate list of any (combination) of the following:
* <code>all</code>
* <code>ai</code>
* <code>enviroment</code>
* <code>flight</code>
* etc. See {{simgear file|simgear/debug/debug_types.h}} for the complete list of available classes.


Logging settings can be modified using the <code>--log-level=[level]</code> [[command line]] option, detailed help about most available command line options can be obtained from the fgfs executable by calling it with the following arguments: <code>--help --verbose</code>.
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 framework, or the [[generic protocol]].  See [[Logging properties]] and [[Generic protocol]] for more details.
== Related content ==
* [[Command line options#Debugging Options]]


== External links ==
== External links ==
* {{repo link|site=gito|proj=fg/simgear|path=simgear/debug/logstream.cxx}}
=== Source files ===
* {{repo link|site=gito|proj=fg/simgear|path=simgear/debug/logstream.hxx}}
* {{simgear file|simgear/debug/logstream.cxx}}
* {{repo link|site=gito|proj=fg/simgear|path=simgear/debug/debug_types.h}}
* {{simgear file|simgear/debug/logstream.hxx}}
* {{simgear file|simgear/debug/debug_types.h}}


[[Category:Core developer documentation]]
[[Category:Core developer documentation]]

Revision as of 19:58, 9 April 2019

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 seperate list of any (combination) of the following:

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

External links

Source files