# ErrLogger Frequently Asked Questions

## Questions

- Question 1
  Some of my classes have methods
  print(ostream& o)
  printAll(ostream& o)
  Should also these functions be migrated to ErrLoggers?
  Answer
- Question 2
  How can I talk to ErrLogger? How can I turn debugging on/off for a given module?
  Answer

## Answers

- Answer 1
  Some of my classes have methods
  print(ostream& o)
  printAll(ostream& o)
  Should also these functions be migrated to ErrLoggers?
  If these functions may be called during the execution of a production executable, such as a framework job, they should be called using the error logger. One elegant solution to this problem that does not tie your class to the error logger for only this print method is to define operator<< as a friend to this class. Then the syntax for printing your object using the error logger would be:
  yourClass theObj;
  ErrMsg(severity) << theObj << endmsg;
  Your class could be printed using the error logger without operator<<, but this is by far the simplest, most natural, and most elegant way of doing this.
- Answer 2
  How can I talk to ErrLogger? How can I turn debugging on/off for a given module?

  For stand-alone jobs, the minimum severity of messages can be set at the construction time of ErrStdLog. ErrStdLog needs only to be instantiated somewhere before the first ErrMsg command is encountered. Presumably, this would happen at the very beginning of the program.

  For framework applications, the minimum severity to be printed can be determined on the module level. The module parameters verbose and production determine the minimum severity. The minimum severity for the possible configurations is shown below.

  |  | Verbose
  |  | true | false
  Production | true | debugging | warning
  false | debugging | routine