CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/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 #include <vector>
00031 
00032 // user include files
00033 
00034 #include "FWCore/MessageLogger/interface/ErrorObj.h"
00035 
00036 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
00037 #include "DataFormats/Provenance/interface/EventID.h"
00038 #include "FWCore/MessageLogger/interface/ELseverityLevel.h"
00039 
00040 // forward declarations
00041 
00042 namespace edm  {
00043 class ModuleDescription;
00044 class ParameterSet;
00045 namespace service  {
00046 
00047 
00048 class MessageLogger {
00049 public:
00050   MessageLogger( ParameterSet const &, ActivityRegistry & );
00051 
00052   void  postBeginJob();
00053   void  postEndJob();
00054   void  jobFailure();
00055   
00056   void  preSource  ();
00057   void  postSource ();
00058 
00059   void  preFile       ();
00060   void  preFileClose  ( std::string const&, bool );
00061   void  postFile      ();
00062 
00063   void  preModuleConstruction ( ModuleDescription const & );
00064   void  postModuleConstruction( ModuleDescription const & );
00065 
00066   void  preSourceConstruction ( ModuleDescription const & );
00067   void  postSourceConstruction( ModuleDescription const & );
00068 
00069   void  preModule ( ModuleDescription const & );
00070   void  postModule( ModuleDescription const & );
00071 
00072   void  preModuleBeginJob  ( ModuleDescription const & );
00073   void  postModuleBeginJob ( ModuleDescription const & );
00074   void  preModuleEndJob  ( ModuleDescription const & );
00075   void  postModuleEndJob ( ModuleDescription const & );
00076 
00077   void  preModuleBeginRun  ( ModuleDescription const & );
00078   void  postModuleBeginRun ( ModuleDescription const & );
00079   void  preModuleEndRun  ( ModuleDescription const & );
00080   void  postModuleEndRun ( ModuleDescription const & );
00081 
00082   void  preModuleBeginLumi  ( ModuleDescription const & );
00083   void  postModuleBeginLumi ( ModuleDescription const & );
00084   void  preModuleEndLumi  ( ModuleDescription const & );
00085   void  postModuleEndLumi ( ModuleDescription const & );
00086 
00087   void  preEventProcessing ( edm::EventID const &, edm::Timestamp const & );
00088   void  postEventProcessing( Event const &, EventSetup const & );
00089 
00090   void  preBeginRun    ( const edm::RunID&, const edm::Timestamp& );
00091   void  postBeginRun   ( const edm::Run&, EventSetup const & );
00092   void  preEndRun      ( const edm::RunID&, const edm::Timestamp& );
00093   void  postEndRun     ( const edm::Run&, EventSetup const & );
00094   void  preBeginLumi   ( const edm::LuminosityBlockID&, const edm::Timestamp& );
00095   void  postBeginLumi  ( const edm::LuminosityBlock&, EventSetup const & );
00096   void  preEndLumi     ( const edm::LuminosityBlockID&, const edm::Timestamp& );
00097   void  postEndLumi    ( const edm::LuminosityBlock&, EventSetup const & );
00098 
00099   void  prePathBeginRun   ( const std::string& pathname );
00100   void  postPathBeginRun  ( const std::string& pathname, HLTPathStatus const&);
00101   void  prePathEndRun     ( const std::string& pathname );
00102   void  postPathEndRun    ( const std::string& pathname, HLTPathStatus const&);
00103   void  prePathBeginLumi  ( const std::string& pathname );
00104   void  postPathBeginLumi ( const std::string& pathname, HLTPathStatus const&);
00105   void  prePathEndLumi    ( const std::string& pathname );
00106   void  postPathEndLumi   ( const std::string& pathname, HLTPathStatus const&);
00107   void  preProcessPath    ( const std::string& pathname );
00108   void  postProcessPath   ( const std::string& pathname, HLTPathStatus const&);
00109 
00110 
00111   void  fillErrorObj(edm::ErrorObj& obj) const;
00112   bool  debugEnabled() const { return debugEnabled_; }
00113 
00114   static 
00115   bool  anyDebugEnabled() { return anyDebugEnabled_; }
00116 
00117   static
00118   void  SummarizeInJobReport();
00119   
00120 private:
00121 
00122   // set up the module name in the message drop, and the enable/suppress info
00123   void  establishModule       ( const ModuleDescription& desc,
00124                                 const char* whichPhase );
00125   void  establishModuleCtor   ( const ModuleDescription& desc,
00126                                 const char*  whichPhase );
00127   void  unEstablishModule     ( const ModuleDescription& desc,
00128                                 const char*  whichPhase );
00129   void  establish             ( const char*  whichPhase ); 
00130   void  unEstablish           ( const char*  whichPhase ); 
00131   
00132   edm::EventID curr_event_;
00133 
00134   std::set<std::string> debugEnabledModules_;
00135   std::map<std::string,ELseverityLevel> suppression_levels_;
00136   bool debugEnabled_;
00137   //this is a cache which profiling has shown to be helpful
00138   std::map<const ModuleDescription*, std::string> descToCalcName_;
00139   static bool   anyDebugEnabled_;
00140   static bool everyDebugEnabled_;
00141 
00142   static bool fjrSummaryRequested_;
00143   bool messageServicePSetHasBeenValidated_;
00144   std::string  messageServicePSetValidatationResults_;
00145 
00146   bool nonModule_debugEnabled;
00147   bool nonModule_infoEnabled;
00148   bool nonModule_warningEnabled;  
00149   bool nonModule_errorEnabled;  
00150 
00151   std::vector<ModuleDescription const*> moduleStack_;
00152 
00153 };  // MessageLogger
00154 
00155   inline
00156   bool isProcessWideService(MessageLogger const*) {
00157     return true;
00158   }
00159 
00160 }  // namespace service
00161 
00162 }  // namespace edm
00163 
00164 
00165 
00166 #endif  // FWCore_MessageService_MessageLogger_h
00167