import FWCore.ParameterSet.Config as cms process = cms.Process("MessageLoggerExample") process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring( 'detailedInfo' ,'critical' ,'cerr' ), critical = cms.untracked.PSet( threshold = cms.untracked.string('ERROR') ), detailedInfo = cms.untracked.PSet( threshold = cms.untracked.string('INFO') ), cerr = cms.untracked.PSet( threshold = cms.untracked.string('WARNING') ) ) # set the number of events process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(200) ) process.myAnalysisModule = cms.EDAnalyzer('ModuleThatIssuesMessages') process.p = cms.Path(process.myAnalysisModule)The destinations = {"detailedInfo", ... } parameter establishes one or more file (or ostream) destinations for the messages issued. The destinations can be configured individually to establish filtering of messages.
If messages are issued prior to the initiation of the MessageLogger service, the configuration of these destinations will not yet have occurred. Such messages will be sent to cerr.
-- SudhirMalik - 30-Aug-2011