CMS MessageLogger: Guide To Issuing Messages

CMS MessageLogger Service
Guide To Issuing Messages

The CMS MessageLogger Service is meant to allow code in modules, other services, and other framework "scaffolding" to log messages to a unified message logging and statistics facility.

The MessageLogger Service captures and coordinates messages originating in multiple modules (which, under the CMS framework, will in general be running in multiple threads) into a specified set of destinations. The management of these destinations is based on the ZOOM Error Logger package developed at Fermilab.

All users of the MessageLogger service should read the section on Issuing Messages .

The behavior of the MessageLogger can be adjusted via lines in the job's configuration file (.cfg). Users wishing to customize the behavior of the MessageLogger should read the section on MessageLogger Parameters .


Issuing Messages

In order to issue messages, the module must include the MessageLogger service header:
  #include "FWCore/MessageLogger/interface/MessageLogger.h"
In addition, it is strongly recommended (for consistency with the way all services are used ) that the .cfg file contain at least the line
  service = MessageLogger { }
The braces can enclose specifications of parameters to adjust the MessageLogger behavior (see
MessageLogger Parameters ); if no parameters are supplied, a sensible CMS default behavior is provided.

If the .cfg file does not specify the MessageLogger service, or if a message is issued in code executed before any services are initiated, then the response to issuing a message will be that the content will be sent to cerr. Having included the necessary MessageLogger header, when code wishes to issue a message, one of these functions can be used:

  edm::LogError   ("category") << a << b << ... << z;
  edm::LogWarning ("category") << a << b << ... << z;
  edm::LogInfo    ("category") << a << b << ... << z;
When issuing messages: There is an additional form for issuing a message:
    LogDebug    ("category") << a << b << ... << z;
This is identical to the others, except:

Some other wrinkles about issuing messages:


Feature List

Issuing messages

Configuring destinations

Debug messages

Message Statistics

Framework Job Reports

CMS Framework/EDM Wiki


Mark Fischler
Last modified: November 24, 2005