Updated over 11 years ago by Knödlseder Jürgen

Printing

Introduction

Every GammaLib class should implement a print() method so that information about the object can be obtained by the user. The print() method will return a string that can be dumped on a terminal or into a log file. The print() method will taken an integer argument that specified the chattiness of information that should be put into the string. The following chatter level are defined:
  • chatter=0: Level silent. No information is printed, except of errors
  • chatter=1: Level terse. Only summary information is printed.
  • chatter=2: Level normal. Normal level of information, useful for understanding the class content.
  • chatter=3: Level explicit. Detailed information, useful for understanding the inner workings of the classes.
  • chatter=4: Level verbose. Produces the maximum information, useful for debugging.
The chattiness is implemented using the GChatter type, which is an enumeration that can take the following values:
  • SILENT
  • TERSE
  • NORMAL
  • EXPLICIT
  • VERBOSE

Guidelines

Here some guidelines for the implementation of each chatter level.

SILENT

At this level the print() method should in general return an empty string, unless that some error information is to be printed.

TERSE

At this level, the print() method should only provide a couple of lines. In particular, the content of a class (i.e. observations, events, photons, ...) should not be displayed.

NORMAL

This is the normal information level. The print() method should provide all information relevant that is relevant for a gamma-ray analysis. For example, the observation container will display summary information for each observation.

EXPLICIT

At this level, the print() method should provide also information about the detailed content of an object. For example, the GPhotons class will print all photons it contains.

VERBOSE

At this level, the print() method should also display information that is useful for debugging, such as internal cache states, etc.

Also available in: PDF HTML TXT