User Tools

Site Tools


gaudi:outputlevel

Output Levels

Idea

In the Gaudi-framework, there exist several layers of print-statements. According to the level which is set (f. ex. in an options-file), any message with this level or higher will be printed.

Normal Output Levels

  • DEBUG (2)
  • INFO (3)
  • WARNING (4)
  • ERROR (5)
  • FATAL (6)

Additional

Additionally the following constants are definded:

  • NIL (0)
  • VERBOSE (1)
  • ALWAYS (7)
  • NUM_LEVELS (8)

Add output statements to your code

In your C++-code, you can add these statements the following way, f.ex:

// (A)
warning() << "Could not retrieve tracks. Skipping" << endmsg;
 
// (B)
if ( msgLevel(MSG::WARNING) ) warning() << "Could not retrieve tracks. Skipping" << endmsg;

All the other messages are printed by replacing “warning” with the appropriate level.

Version (B) runs faster when the message level set will not display this message. Therefore version (B) should be used for low-level messages (Debug, Info, Warning) while version (A) is better for Error or Fatal messages.

Change the output level in the options file

In the options file, you can change the output level for a given class by setting:

myClass.OutputLevel = 4

for example for a tool:

Tuple.TupleToolEventInfo.OutputLevel = 4
gaudi/outputlevel.txt · Last modified: 2010/03/19 10:05 by nchiap