CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FWCore/MessageService/interface/MessageLogger.h

Go to the documentation of this file.
00001 #ifndef FWCore_MessageService_MessageLogger_h
00002 #define FWCore_MessageService_MessageLogger_h
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:     Services
00007 // Class  :     MessageLogger
00008 //
00017 //
00018 // Original Author:  W. Brown and M. Fischler
00019 //         Created:  Fri Nov 11 16:38:19 CST 2005
00020 //     Major Split:  Tue Feb 14 15:00:00 CST 2006
00021 //                      See FWCore/MessageLogger/MessageLogger.h
00022 //
00023 
00024 // system include files
00025 
00026 #include <memory>
00027 #include <string>
00028 #include <set>
00029 #include <map>
00030 
00031 // user include files
00032 
00033 #include "FWCore/MessageLogger/interface/ErrorObj.h"
00034 
00035 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
00036 #include "DataFormats/Provenance/interface/EventID.h"
00037 #include "FWCore/MessageLogger/interface/ELseverityLevel.h"
00038 
00039 // forward declarations
00040 
00041 namespace edm  {
00042 class ParameterSet;
00043 namespace service  {
00044 
00045 
00046 class MessageLogger {
00047 public:
00048   MessageLogger( ParameterSet const &, ActivityRegistry & );
00049 
00050   void  postBeginJob();
00051   void  postEndJob();
00052   void  jobFailure();
00053   
00054   void  preSource  ();
00055   void  postSource ();
00056 
00057   void  preFile       ();
00058   void  preFileClose  ();
00059   void  postFile      ();
00060 
00061   void  preModuleConstruction ( ModuleDescription const & );
00062   void  postModuleConstruction( ModuleDescription const & );
00063 
00064   void  preSourceConstruction ( ModuleDescription const & );
00065   void  postSourceConstruction( ModuleDescription const & );
00066 
00067   void  preModule ( ModuleDescription const & );
00068   void  postModule( ModuleDescription const & );
00069 
00070   void  preModuleBeginJob  ( ModuleDescription const & );
00071   void  postModuleBeginJob ( ModuleDescription const & );
00072   void  preModuleEndJob  ( ModuleDescription const & );
00073   void  postModuleEndJob ( ModuleDescription const & );
00074 
00075   void  preModuleBeginRun  ( ModuleDescription const & );
00076   void  postModuleBeginRun ( ModuleDescription const & );
00077   void  preModuleEndRun  ( ModuleDescription const & );
00078   void  postModuleEndRun ( ModuleDescription const & );
00079 
00080   void  preModuleBeginLumi  ( ModuleDescription const & );
00081   void  postModuleBeginLumi ( ModuleDescription const & );
00082   void  preModuleEndLumi  ( ModuleDescription const & );
00083   void  postModuleEndLumi ( ModuleDescription const & );
00084 
00085   void  preEventProcessing ( edm::EventID const &, edm::Timestamp const & );
00086   void  postEventProcessing( Event const &, EventSetup const & );
00087 
00088   void  preBeginRun    ( const edm::RunID&, const edm::Timestamp& );
00089   void  postBeginRun   ( const edm::Run&, EventSetup const & );
00090   void  preEndRun      ( const edm::RunID&, const edm::Timestamp& );
00091   void  postEndRun     ( const edm::Run&, EventSetup const & );
00092   void  preBeginLumi   ( const edm::LuminosityBlockID&, const edm::Timestamp& );
00093   void  postBeginLumi  ( const edm::LuminosityBlock&, EventSetup const & );
00094   void  preEndLumi     ( const edm::LuminosityBlockID&, const edm::Timestamp& );
00095   void  postEndLumi    ( const edm::LuminosityBlock&, EventSetup const & );
00096 
00097   void  prePathBeginRun   ( const std::string& pathname );
00098   void  postPathBeginRun  ( const std::string& pathname, HLTPathStatus const&);
00099   void  prePathEndRun     ( const std::string& pathname );
00100   void  postPathEndRun    ( const std::string& pathname, HLTPathStatus const&);
00101   void  prePathBeginLumi  ( const std::string& pathname );
00102   void  postPathBeginLumi ( const std::string& pathname, HLTPathStatus const&);
00103   void  prePathEndLumi    ( const std::string& pathname );
00104   void  postPathEndLumi   ( const std::string& pathname, HLTPathStatus const&);
00105   void  preProcessPath    ( const std::string& pathname );
00106   void  postProcessPath   ( const std::string& pathname, HLTPathStatus const&);
00107 
00108 
00109   void  fillErrorObj(edm::ErrorObj& obj) const;
00110   bool  debugEnabled() const { return debugEnabled_; }
00111 
00112   static 
00113   bool  anyDebugEnabled() { return anyDebugEnabled_; }
00114 
00115   static
00116   void  SummarizeInJobReport();
00117   
00118 private:
00119 
00120   // set up the module name in the message drop, and the enable/suppress info
00121   void  establishModule       ( const ModuleDescription& desc,
00122                                 const char* whichPhase );
00123   void  establishModuleCtor   ( const ModuleDescription& desc,
00124                                 const char*  whichPhase );
00125   void  unEstablishModule     ( const ModuleDescription& desc,
00126                                 const char*  whichPhase );
00127   void  establish             ( const char*  whichPhase ); 
00128   void  unEstablish           ( const char*  whichPhase ); 
00129   
00130   edm::EventID curr_event_;
00131 
00132   std::set<std::string> debugEnabledModules_;
00133   std::map<std::string,ELseverityLevel> suppression_levels_;
00134   bool debugEnabled_;
00135   //this is a cache which profiling has shown to be helpful
00136   std::map<const ModuleDescription*, std::string> descToCalcName_;
00137   static bool   anyDebugEnabled_;
00138   static bool everyDebugEnabled_;
00139 
00140   static bool fjrSummaryRequested_;
00141   bool messageServicePSetHasBeenValidated_;
00142   std::string  messageServicePSetValidatationResults_;
00143 
00144   bool nonModule_debugEnabled;
00145   bool nonModule_infoEnabled;
00146   bool nonModule_warningEnabled;  
00147   bool nonModule_errorEnabled;  
00148   
00149 };  // MessageLogger
00150 
00151   inline
00152   bool isProcessWideService(MessageLogger const*) {
00153     return true;
00154   }
00155 
00156 }  // namespace service
00157 
00158 }  // namespace edm
00159 
00160 
00161 
00162 #endif  // FWCore_MessageService_MessageLogger_h
00163