import FWCore.ParameterSet.Config as cms process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring( 'detailedInfo' ,'critical' ,'cout' ,'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(5) ) process.myAnalysisModule = cms.EDAnalyzer('ModuleThatIssuesMessages') process.p = cms.Path(process.myAnalysisModule)The { ..., "cerr", ... } in the list of destinations refers to message information streamed to std::cout rather than to a file named cerr.
It is possible for a message to be sent to cerr even though no such stream is listed in the configuration file, since any message sent before services are configured will go to a cerr destination. However, unless cerr appears in the configuration file as a destination, that destination will be turned off once the service has been configured.
The MessageLogger service provides no way to create a destination writing to an ordinary file named cout or cerr.