Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:39

0001 # timingFilteredMLexample -- 
0002 #                  an example Configuration file for MessageLogger service:
0003 
0004 # Illustrates how to limit the output of a category of message to one
0005 # destination but not to another.
0006 #
0007 # This example sets up logging to a file and to cout, and establishes the
0008 # timing service.  The idea is to deliver all messages created by LogWarning 
0009 # and above to cout (as would happen in usual production jobs) EXCEPT to
0010 # suppress the timing messages for cout (but not for the other log file).
0011 #
0012 # This sort of setup was requested by Florian Beaudette, Jean-Roch, Peter Elmer
0013 # and for a time was rendered impossible because the timing service had used
0014 # LogAbsolute for its output; that has since been modified.
0015 #
0016 # cmsRun timingFilteredMLexample_cfg.py outputs to cout, and also produces 
0017 # timingFilteredMLexample.log.  The output to cout should not contain per-event
0018 # timing information.
0019 
0020 import FWCore.ParameterSet.Config as cms
0021 
0022 process = cms.Process("TEST")
0023 
0024 import FWCore.Framework.test.cmsExceptionsFatal_cff
0025 process.options = FWCore.Framework.test.cmsExceptionsFatal_cff.options
0026 
0027 process.load("FWCore.MessageService.test.Services_cff")
0028 
0029 # Here is where the timng service is enabled
0030 
0031 process.Timing =  cms.Service("Timing")
0032 
0033 # Here is the configuration of the MessgeLogger Service:
0034 
0035 process.MessageLogger = cms.Service("MessageLogger",
0036     cerr = cms.untracked.PSet(
0037         enable = cms.untracked.bool(False)
0038     ),
0039     cout = cms.untracked.PSet(
0040         TimeEvent = cms.untracked.PSet(
0041             limit = cms.untracked.int32(0)
0042         ),
0043         TimeModule = cms.untracked.PSet(
0044             limit = cms.untracked.int32(0)
0045         ),
0046         TimeReport = cms.untracked.PSet(
0047             limit = cms.untracked.int32(0)
0048         ),
0049         cat_B = cms.untracked.PSet(
0050             limit = cms.untracked.int32(0)
0051         ),
0052         enable = cms.untracked.bool(True),
0053         threshold = cms.untracked.string('WARNING')
0054     ),
0055     files = cms.untracked.PSet(
0056         timingFilteredML = cms.untracked.PSet(
0057             threshold = cms.untracked.string('WARNING')
0058         )
0059     )
0060 )
0061 
0062 process.maxEvents = cms.untracked.PSet(
0063     input = cms.untracked.int32(5)
0064 )
0065 
0066 process.source = cms.Source("EmptySource")
0067 
0068 process.sendSomeMessages = cms.EDAnalyzer("MLexampleModule_1")
0069 
0070 process.p = cms.Path(process.sendSomeMessages)