CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ELerrorList.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // ELerrorList.cc
4 //
5 //
6 // 9/21/00 mf Created
7 // 10/4/00 mf excludeModule()
8 // intializer for moduleOfINterest in constructors
9 // 4/4/01 mf Simplify filter/exclude logic by using base class
10 // method thisShouldBeIgnored(). Eliminate
11 // moduleOfinterest and moduleToexclude.
12 //
13 // ----------------------------------------------------------------------
14 
15 
19 
21 
22 // Possible Traces:
23 // #define ELerrorListCONSTRUCTOR_TRACE
24 // #define ELerrorListTRACE_LOG
25 
26 namespace edm {
27 namespace service {
28 
29 
30 // ----------------------------------------------------------------------
31 // Constructors:
32 // ----------------------------------------------------------------------
33 
34 ELerrorList::ELerrorList(std::list<edm::ErrorObj> & errorList) :
35  ELdestination (),
36  errorObjs ( errorList )
37 {
38 
39  #ifdef ELerrorListCONSTRUCTOR_TRACE
40  std::cerr << "Constructor for ELerrorList()\n";
41  #endif
42 
43 } // ELerrorList()
44 
46  ELdestination (),
47  errorObjs ( orig.errorObjs )
48 {
49 
50  #ifdef ELerrorListCONSTRUCTOR_TRACE
51  std::cerr << "Copy Constructor for ELerrorList()\n";
52  #endif
53 
57  ignoreThese = orig.ignoreThese;
58 
59 } // ELerrorList()
60 
61 
63 
64  #ifdef ELerrorListCONSTRUCTOR_TRACE
65  std::cerr << "Destructor for ELerrorList\n";
66  #endif
67 
68 } // ~ELerrorList()
69 
70 
71 // ----------------------------------------------------------------------
72 // Methods invoked by the ELadministrator:
73 // ----------------------------------------------------------------------
74 
77 
78  return new ELerrorList( *this );
79 
80 } // clone()
81 
82 
84 
85  #ifdef ELerrorListTRACE_LOG
86  std::cerr << " =:=:=: Log to an ELerrorList \n";
87  #endif
88 
89  edm::ErrorObj m (msg);
90 
91  // See if this message is to be acted upon, and add it to limits table
92  // if it was not already present:
93  //
94  if ( msg.xid().severity < threshold ) return false;
95  if ( thisShouldBeIgnored(msg.xid().module) ) return false;
96  if ( ! limits.add( msg.xid() ) ) return false;
97 
98  #ifdef ELerrorListTRACE_LOG
99  std::cerr << " =:=:=: Limits table work done \n";
100  #endif
101 
102  // add a last item to the message: The fullContext string supplied.
103 
104  m.emitToken(ELadministrator::instance()->getContextSupplier().fullContext());
105 
106  // Now just put m on the list:
107 
108  errorObjs.push_back(m);
109 
110  // Done; message has been fully processed:
111  //
112 
113  #ifdef ELerrorListTRACE_LOG
114  std::cerr << " =:=:=: log(msg) done: \n";
115  #endif
116 
117  return true;
118 
119 } // log()
120 
121 
122 // Remainder are from base class.
123 
124 
125 // ----------------------------------------------------------------------
126 // errorList methods:
127 // ----------------------------------------------------------------------
128 
129 
130 // ----------------------------------------------------------------------
131 
132 } // end of namespace service
133 } // end of namespace edm
ELseverityLevel severity
Definition: ELextendedID.h:36
virtual ELerrorList * clone() const
Definition: ELerrorList.cc:76
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
virtual bool thisShouldBeIgnored(const ELstring &s) const
const ELextendedID & xid() const
Definition: ErrorObj.cc:146
bool add(const ELextendedID &xid)
ELerrorList(std::list< edm::ErrorObj > &errorList)
Definition: ELerrorList.cc:34
virtual bool log(const edm::ErrorObj &msg)
Definition: ELerrorList.cc:83
static ELadministrator * instance()
std::list< edm::ErrorObj > & errorObjs
Definition: ELerrorList.h:46