CMS 3D CMS Logo

ELadministrator.h
Go to the documentation of this file.
1 #ifndef MessageService_ELadministrator_h
2 #define MessageService_ELadministrator_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // ELadminstrator.h provides the singleton class that the framework uses to
7 // control logger behavior including attaching destinations.
8 // Includes the methods used by ErrorLog to evoke the logging
9 // behavior in the destinations owned by the ELadminstrator.
10 //
11 // ----------------------------------------------------------------------
12 //
13 // ELadministrator The singleton logger class. One does not instantiate
14 // an ELadministrator. Instead, do
15 // ELadministrator * logger = ELadministrator::instance();
16 // to get a pointer to the (unique) ELadministrator.
17 //
18 // Only the framework should use ELadministrator directly.
19 // Physicist users get at it indirectly through using an ErrorLog
20 // set up in their Module class.
21 //
22 // ELadminDestroyer A class whose sole purpose is the destruction of the
23 // ELadministrator when the program is over. Right now,
24 // we do not have anything that needs to be done when the
25 // ELadministrator (and thus the error logger) goes away;
26 // but since by not deleting the copies of ELdestination's
27 // that were attached we would be left with an apparent
28 // memory leak, we include a protected destructor which will
29 // clean up. ELadminDestroyer provides the only way for
30 // this destructor to be called.
31 //
32 // ----------------------------------------------------------------------
33 //
34 // 7/2/98 mf Created file.
35 // 2/29/00 mf Added method swapContextSupplier for ELrecv to use.
36 // 4/5/00 mf Added method swapProcess for same reason: ELrecv wants to
37 // be able to mock up the process and reset it afterward.
38 // 6/6/00 web Consolidate ELadministrator/X; adapt to consolidated
39 // ELcout/X.
40 // 6/14/00 web Declare classes before granting friendship.
41 // 6/4/01 mf Grant friedship to ELtsErrorLog
42 // 3/6/02 mf Items for recovering handles to attached destinations:
43 // the attachedDestinations map,
44 // an additional signature for attach(),
45 // and getELdestControl() method
46 // 3/17/04 mf exitThreshold and setExitThreshold
47 // 1/10/06 mf finish
48 //
49 // ----------------------------------------------------------------------
50 
56 
57 #include <memory>
58 
59 namespace edm {
60  namespace service {
61 
62  // ----------------------------------------------------------------------
63  // ELadministrator:
64  // ----------------------------------------------------------------------
65 
67  public:
70 
71  //Replaces ErrorLog which is no longer needed
72  void log(edm::ErrorObj& msg);
73 
74  // --- furnish/recall destinations:
75  //
76  std::shared_ptr<ELdestination> attach(std::shared_ptr<ELdestination> sink);
77 
78  // --- handle severity information:
79  //
81  int severityCount(const messagelogger::ELseverityLevel& sev) const;
85  void resetSeverityCount(); // reset all
86 
87  // --- apply the following actions to all attached destinations:
88  //
90  void setLimits(const std::string& id, int limit);
91  void setLimits(const messagelogger::ELseverityLevel& sev, int limit);
92  void setIntervals(const std::string& id, int interval);
94  void setTimespans(const std::string& id, int seconds);
96  void wipe();
97  void finish();
98 
99  protected:
100  // --- member data accessors:
101  //
105  int severityCounts(int lev) const;
106 
107  private:
108  // --- traditional member data:
109  //
110  std::list<edm::propagate_const<std::shared_ptr<ELdestination>>> sinks_;
113 
114  std::map<std::string, edm::propagate_const<std::shared_ptr<ELdestination>>> attachedDestinations_;
115 
116  }; // ELadministrator
117 
118  // ----------------------------------------------------------------------
119 
120  } // end of namespace service
121 } // end of namespace edm
122 
123 #endif // MessageService_ELadministrator_h
edm::service::ELadministrator::resetSeverityCount
void resetSeverityCount()
Definition: ELadministrator.cc:159
service
Definition: service.py:1
ELlist.h
propagate_const.h
edm::service::ELadministrator::abortThreshold
const messagelogger::ELseverityLevel & abortThreshold() const
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ErrorObj
Definition: ErrorObj.h:43
ELseverityLevel.h
edm::service::ELadministrator::severityCounts
int severityCounts(int lev) const
Definition: ELadministrator.cc:170
to
ErrorObj.h
edm::service::ELadministrator::ELadministrator
ELadministrator()
Definition: ELadministrator.cc:234
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::service::ELadministrator::setLimits
void setLimits(const std::string &id, int limit)
Definition: ELadministrator.cc:186
edm::service::ELadministrator::setIntervals
void setIntervals(const std::string &id, int interval)
Definition: ELadministrator.cc:198
edm::service::ELadministrator::highSeverity_
messagelogger::ELseverityLevel highSeverity_
Definition: ELadministrator.h:111
edm::service::ELadministrator
Definition: ELadministrator.h:66
seconds
double seconds()
edm::messagelogger::ELseverityLevel::nLevels
Definition: ELseverityLevel.h:43
edm::service::ELadministrator::wipe
void wipe()
Definition: ELadministrator.cc:222
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::service::ELadministrator::setThresholds
void setThresholds(const messagelogger::ELseverityLevel &sev)
Definition: ELadministrator.cc:180
ELdestination.h
edm::service::ELadministrator::~ELadministrator
~ELadministrator()
Definition: ELadministrator.cc:246
edm::service::ELadministrator::checkSeverity
messagelogger::ELseverityLevel checkSeverity()
Definition: ELadministrator.cc:125
readEcalDQMStatus.interval
interval
Definition: readEcalDQMStatus.py:18
edm::service::ELadministrator::severityCount
int severityCount(const messagelogger::ELseverityLevel &sev) const
edm::service::ELadministrator::setTimespans
void setTimespans(const std::string &id, int seconds)
Definition: ELadministrator.cc:210
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
edm::service::ELadministrator::sinks_
std::list< edm::propagate_const< std::shared_ptr< ELdestination > > > sinks_
Definition: ELadministrator.h:110
edm::messagelogger::ELseverityLevel
Definition: ELseverityLevel.h:26
edm::service::ELadministrator::finish
void finish()
Definition: ELadministrator.cc:228
edm::service::ELadministrator::exitThreshold
const messagelogger::ELseverityLevel & exitThreshold() const
edm::service::ELadministrator::severityCounts_
int severityCounts_[messagelogger::ELseverityLevel::nLevels]
Definition: ELadministrator.h:112
edm::service::ELadministrator::log
void log(edm::ErrorObj &msg)
Definition: ELadministrator.cc:94
edm::service::ELadministrator::highSeverity
const messagelogger::ELseverityLevel & highSeverity() const
Definition: ELadministrator.cc:168
edm::service::ELadministrator::attach
std::shared_ptr< ELdestination > attach(std::shared_ptr< ELdestination > sink)
Definition: ELadministrator.cc:119
edm::service::ELadministrator::attachedDestinations_
std::map< std::string, edm::propagate_const< std::shared_ptr< ELdestination > > > attachedDestinations_
Definition: ELadministrator.h:114