User Tools

Site Tools


gaudi:outputlevel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
gaudi:outputlevel [2009/01/28 12:16] – created nchiapgaudi:outputlevel [2010/03/19 10:05] (current) nchiap
Line 1: Line 1:
-=== Output Levels === +====== Output Levels ====== 
-Any message with the given level or higher will be printed.+===== 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 == +===== Normal Output Levels =====
   * DEBUG (2)   * DEBUG (2)
   * INFO (3)   * INFO (3)
Line 8: Line 9:
   * ERROR (5)   * ERROR (5)
   * FATAL (6)    * FATAL (6) 
-== Additional == + 
-additionally the following constants are definded:+===== Additional ===== 
 +Additionally the following constants are definded:
   * NIL (0)   * NIL (0)
   * VERBOSE (1)   * VERBOSE (1)
   * ALWAYS (7)   * ALWAYS (7)
   * NUM_LEVELS (8)   * NUM_LEVELS (8)
 +
 +===== Add output statements to your code =====
 +In your C++-code, you can add these statements the following way, f.ex:
 +<code c++>
 +// (A)
 +warning() << "Could not retrieve tracks. Skipping" << endmsg;
 +
 +// (B)
 +if ( msgLevel(MSG::WARNING) ) warning() << "Could not retrieve tracks. Skipping" << endmsg;
 +</code>
 +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:
 +<code>
 +myClass.OutputLevel = 4
 +</code>
 +for example for a tool:
 +<code>
 +Tuple.TupleToolEventInfo.OutputLevel = 4
 +</code>
 +
gaudi/outputlevel.1233141399.txt.gz · Last modified: by nchiap