CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
edm::service::ELtsErrorLog Class Reference

#include <ELtsErrorLog.h>

Inheritance diagram for edm::service::ELtsErrorLog:
edm::service::ThreadSafeErrorLog< Mutex >

Public Member Functions

 ELtsErrorLog ()
 
 ELtsErrorLog (const ELstring &pkgName)
 
 ELtsErrorLog (const ErrorLog &ee)
 
 ELtsErrorLog (const ELtsErrorLog &ee)
 
void item (int n)
 
void item (unsigned int n)
 
void item (long n)
 
void item (unsigned long n)
 
void item (short n)
 
void item (unsigned short n)
 
void item (const ELstring &s)
 
ELtsErrorLogoperator= (const ELtsErrorLog &)
 
void swap (ELtsErrorLog &)
 

Protected Member Functions

void dispatch (edm::ErrorObj &msg)
 
bool getELdestControl (const ELstring &name, ELdestControl &theDestControl) const
 
void initiateMsg (const ELseverityLevel &sev, const ELstring &id)
 
void initiateMsg (int debugLevel)
 
bool pokeMsg (edm::ErrorObj &msg)
 
void setDebugMessages (ELseverityLevel sev, ELstring id)
 
void setDebugVerbosity (int debugVerbosity)
 
ELseverityLevel setDiscardThreshold (ELseverityLevel sev)
 
int setHexTrigger (int trigger)
 
void setModule (const ELstring &modName)
 
void setPackage (const ELstring &pkgName)
 
void setProcess (const ELstring &procName)
 
void setSubroutine (const ELstring &subName)
 
virtual ~ELtsErrorLog ()
 

Protected Attributes

ELadministratora
 
ErrorLog e
 
edm::ErrorObj msg
 
bool msgIsActive
 
ELstring process
 

Detailed Description

Definition at line 27 of file ELtsErrorLog.h.

Constructor & Destructor Documentation

edm::service::ELtsErrorLog::ELtsErrorLog ( )

Definition at line 44 of file ELtsErrorLog.cc.

References gather_cfg::cout.

46 , e()
47 , process("")
48 , msgIsActive (false)
49 , msg(ELunspecified, "...")
50 {
51  #ifdef ErrorLogCONSTRUCTOR_TRACE
52  std::cout << "Constructor for ThreadSafeErrorLog\n";
53  #endif
54 }
ELslProxy< ELunspecifiedGen > const ELunspecified
static ELadministrator * instance()
tuple cout
Definition: gather_cfg.py:121
edm::service::ELtsErrorLog::ELtsErrorLog ( const ELstring pkgName)

Definition at line 56 of file ELtsErrorLog.cc.

References gather_cfg::cout.

58 , e(pkgName)
59 , process("")
60 , msgIsActive (false)
61 , msg(ELunspecified, "...")
62 {
63  #ifdef ErrorLogCONSTRUCTOR_TRACE
64  std::cout << "Constructor for ThreadSafeErrorLog (with pkgName = "
65  << pkgName << ")\n";
66  #endif
67 }
ELslProxy< ELunspecifiedGen > const ELunspecified
static ELadministrator * instance()
tuple cout
Definition: gather_cfg.py:121
edm::service::ELtsErrorLog::ELtsErrorLog ( const ErrorLog ee)

Definition at line 69 of file ELtsErrorLog.cc.

References gather_cfg::cout.

71 , e(ee)
72 , process("")
73 , msgIsActive (false)
74 , msg(ELunspecified, "...")
75 {
76  #ifdef ErrorLogCONSTRUCTOR_TRACE
77  std::cout << "Constructor for ThreadSafeErrorLog from ErrorLog\n";
78  #endif
79 }
ELslProxy< ELunspecifiedGen > const ELunspecified
static ELadministrator * instance()
tuple cout
Definition: gather_cfg.py:121
edm::service::ELtsErrorLog::ELtsErrorLog ( const ELtsErrorLog ee)

Definition at line 81 of file ELtsErrorLog.cc.

References gather_cfg::cout.

83 , e(ee.e)
84 , process(ee.process)
85 , msgIsActive (ee.msgIsActive)
86 , msg(ee.msg)
87 {
88  #ifdef ErrorLogCONSTRUCTOR_TRACE
89  std::cout << "Copy constructor for ThreadSafeErrorLog \n";
90  #endif
91 }
static ELadministrator * instance()
tuple cout
Definition: gather_cfg.py:121
edm::service::ELtsErrorLog::~ELtsErrorLog ( )
protectedvirtual

Definition at line 93 of file ELtsErrorLog.cc.

References gather_cfg::cout.

94 {
95  #ifdef ErrorLogCONSTRUCTOR_TRACE
96  std::cout << "Destructor for ThreadSafeErrorLog\n";
97  #endif
98 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void edm::service::ELtsErrorLog::dispatch ( edm::ErrorObj msg)
protected

Definition at line 322 of file ELtsErrorLog.cc.

References a, edm::service::ELadministrator::abortThreshold(), edm::service::ELadministrator::attach(), dtNoiseDBValidation_cfg::cerr, edm::service::ELadministrator::context_, edm::ELhighestSeverity, edm::ELseverityLevel::getLevel(), edm::service::ELadministrator::highSeverity_, edm::service::msgabort(), edm::ErrorObj::setReactedTo(), edm::ELextendedID::severity, edm::service::ELadministrator::severityCounts_, edm::service::ELadministrator::sinks(), and edm::ErrorObj::xid().

322  {
323 
324  // NOTE -- this is never called except in cases where a <Mutex> LOCK
325  // is in scope. That is, this code should be treated as a
326  // critical section.
327 
328  // severity level statistics keeping:
329  int lev = msg.xid().severity.getLevel();
330  ++ a->severityCounts_[lev];
331  if ( lev > a->highSeverity_.getLevel() )
332  a->highSeverity_ = msg.xid().severity;
333 
334  // context-based editing (if specified; usually just returns)
335  a->context_->editErrorObj( msg );
336 
337  // ----- send the message to each destination:
338  //
339  if (a->sinks().begin() == a->sinks().end()) {
340  std::cerr << "\nERROR LOGGED WITHOUT DESTINATION!\n";
341  std::cerr << "Attaching destination \"cerr\" to ELadministrator by default\n"
342  << std::endl;
343  a->attach(ELoutput(std::cerr));
344  }
345  std::list<boost::shared_ptr<ELdestination> >::iterator d;
346  for ( d = a->sinks().begin(); d != a->sinks().end(); ++d )
347  if ( (*d)->log( msg ) )
348  msg.setReactedTo (true );
349 
350 
351  if ( msg.xid().severity.getLevel() >= a->abortThreshold().getLevel()
352  &&
354  msgabort();
355  }
356 
357 }
ELseverityLevel severity
Definition: ELextendedID.h:36
std::list< boost::shared_ptr< ELdestination > > & sinks()
int severityCounts_[ELseverityLevel::nLevels]
static void msgabort()
ELslProxy< ELhighestSeverityGen > const ELhighestSeverity
virtual void setReactedTo(bool r)
Definition: ErrorObj.cc:210
const ELextendedID & xid() const
Definition: ErrorObj.cc:146
boost::shared_ptr< ELcontextSupplier > context_
ELdestControl attach(const ELdestination &sink)
const ELseverityLevel & abortThreshold() const
bool edm::service::ELtsErrorLog::getELdestControl ( const ELstring name,
ELdestControl theDestControl 
) const
protected

Definition at line 156 of file ELtsErrorLog.cc.

References a, and edm::service::ELadministrator::getELdestControl().

157  {
158  return a->getELdestControl ( name, theDestControl );
159 }
bool getELdestControl(const ELstring &name, ELdestControl &theControl)
void edm::service::ELtsErrorLog::initiateMsg ( const ELseverityLevel sev,
const ELstring id 
)
protected

Definition at line 166 of file ELtsErrorLog.cc.

References edm::ErrorObj::clear(), gather_cfg::cout, edm::service::ErrorLog::discarding, edm::service::ErrorLog::discardThreshold, e, edm::ELseverityLevel::getName(), edm::service::ErrorLog::module, msg, msgIsActive, process, edm::ErrorObj::set(), edm::ErrorObj::setModule(), edm::ErrorObj::setProcess(), edm::ErrorObj::setReactedTo(), edm::ErrorObj::setSubroutine(), and edm::service::ErrorLog::subroutine.

Referenced by item().

167 {
168  if ( sev < e.discardThreshold ) {
169  e.discarding = true;
170  return;
171  }
172  e.discarding = false;
173  #ifdef ErrorLogENDMSG_TRACE
174  std::cout << "=:=:=: precautionary endmsg ( "
175  << sev.getName() << ", " << id << ")\n";
176  #endif
177 
178  // Unlike the case for ErrorLog, it is not necessary to check
179  // msgIsActive because the calling code was forced to do that
180  // (since if it WAS active, ELtsErrorLog can't do the Mutex LOCK.)
181 
182  // ----- form ErrorObj for this new message:
183  //
184  msg.clear();
185  msgIsActive = true;
186  msg.set ( sev, id );
187  msg.setProcess ( process );
188  msg.setModule ( e.module );
190  msg.setReactedTo ( false );
191 
192  return;
193 
194 } // operator()( )
virtual void clear()
Definition: ErrorObj.cc:262
virtual void set(const ELseverityLevel &sev, const ELstring &id)
Definition: ErrorObj.cc:249
virtual void setSubroutine(const ELstring &subroutine)
Definition: ErrorObj.cc:193
virtual void setReactedTo(bool r)
Definition: ErrorObj.cc:210
ELseverityLevel discardThreshold
Definition: ErrorLog.h:129
virtual void setProcess(const ELstring &proc)
Definition: ErrorObj.cc:203
tuple cout
Definition: gather_cfg.py:121
virtual void setModule(const ELstring &module)
Definition: ErrorObj.cc:188
void edm::service::ELtsErrorLog::initiateMsg ( int  debugLevel)
protected
void edm::service::ELtsErrorLog::item ( int  n)

Definition at line 213 of file ELtsErrorLog.cc.

References edm::service::ErrorLog::discarding, e, edm::ErrorObj::emitToken(), edm::service::ErrorLog::hexTrigger, m, and msg.

Referenced by Vispa.Views.TableView.TableView::_selectedRow(), Vispa.Views.TableView.TableView::itemSelectionChanged(), Vispa.Views.TableView.TableView::select(), and Vispa.Views.TableView.TableView::selection().

213  {
214  if (e.discarding) return;
215  std::ostringstream ost;
216  ost << n << ' ';
217  int m = (n<0) ? -n : n;
218  if ( (e.hexTrigger >= 0) && (m >= e.hexTrigger) ) {
219  ost << "[0x"
220  << std::hex << std::setw(8) << std::setfill('0')
221  << n << "] ";
222  }
223  msg.emitToken( ost.str() );
224 }
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
void edm::service::ELtsErrorLog::item ( unsigned int  n)

Definition at line 226 of file ELtsErrorLog.cc.

References edm::service::ErrorLog::discarding, e, edm::ErrorObj::emitToken(), edm::service::ErrorLog::hexTrigger, and msg.

Referenced by Vispa.Views.TableView.TableView::_selectedRow(), Vispa.Views.TableView.TableView::itemSelectionChanged(), Vispa.Views.TableView.TableView::select(), and Vispa.Views.TableView.TableView::selection().

226  {
227  if (e.discarding) return;
228  std::ostringstream ost;
229  ost << n << ' ';
230  if ( (e.hexTrigger >= 0) &&
231  (n >= static_cast<unsigned int>(e.hexTrigger)) ) {
232  ost << "[0x"
233  << std::hex << std::setw(8) << std::setfill('0')
234  << n << "] ";
235  }
236  msg.emitToken( ost.str() );
237 }
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
void edm::service::ELtsErrorLog::item ( long  n)

Definition at line 239 of file ELtsErrorLog.cc.

References edm::service::ErrorLog::discarding, e, edm::ErrorObj::emitToken(), edm::service::ErrorLog::hexTrigger, dttmaxenums::L, m, msg, and tablePrinter::width.

Referenced by Vispa.Views.TableView.TableView::_selectedRow(), Vispa.Views.TableView.TableView::itemSelectionChanged(), Vispa.Views.TableView.TableView::select(), and Vispa.Views.TableView.TableView::selection().

239  {
240  if (e.discarding) return;
241  std::ostringstream ost;
242  ost << n << ' ';
243  long m = (n<0) ? -n : n;
244  if ( (e.hexTrigger >= 0) && (m >= e.hexTrigger) ) {
245  int width = 8;
246  if ( static_cast<unsigned long>(n) > 0xFFFFFFFFL ) width = 16;
247  ost << "[0x"
248  << std::hex << std::setw(width) << std::setfill('0')
249  << n << "] ";
250  }
251  msg.emitToken( ost.str() );
252 }
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
void edm::service::ELtsErrorLog::item ( unsigned long  n)

Definition at line 254 of file ELtsErrorLog.cc.

References edm::service::ErrorLog::discarding, e, edm::ErrorObj::emitToken(), edm::service::ErrorLog::hexTrigger, msg, and tablePrinter::width.

Referenced by Vispa.Views.TableView.TableView::_selectedRow(), Vispa.Views.TableView.TableView::itemSelectionChanged(), Vispa.Views.TableView.TableView::select(), and Vispa.Views.TableView.TableView::selection().

254  {
255  if (e.discarding) return;
256  std::ostringstream ost;
257  ost << n << ' ';
258  if ( (e.hexTrigger >= 0) &&
259  (n >= static_cast<unsigned long>(e.hexTrigger)) ) {
260  int width = 8;
261  if ( n > 0xFFFFFFFFL ) width = 16;
262  ost << "[0x"
263  << std::hex << std::setw(width) << std::setfill('0')
264  << n << "] ";
265  }
266  msg.emitToken( ost.str() );
267 }
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
void edm::service::ELtsErrorLog::item ( short  n)

Definition at line 269 of file ELtsErrorLog.cc.

References edm::service::ErrorLog::discarding, e, edm::ErrorObj::emitToken(), edm::service::ErrorLog::hexTrigger, m, and msg.

Referenced by Vispa.Views.TableView.TableView::_selectedRow(), Vispa.Views.TableView.TableView::itemSelectionChanged(), Vispa.Views.TableView.TableView::select(), and Vispa.Views.TableView.TableView::selection().

269  {
270  if (e.discarding) return;
271  std::ostringstream ost;
272  ost << n << ' ';
273  short m = (n<0) ? -n : n;
274  if ( (e.hexTrigger >= 0) && (m >= e.hexTrigger) ) {
275  ost << "[0x"
276  << std::hex << std::setw(4) << std::setfill('0')
277  << n << "] ";
278  }
279  msg.emitToken( ost.str() );
280 }
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
void edm::service::ELtsErrorLog::item ( unsigned short  n)

Definition at line 282 of file ELtsErrorLog.cc.

References edm::service::ErrorLog::discarding, e, edm::ErrorObj::emitToken(), edm::service::ErrorLog::hexTrigger, and msg.

Referenced by Vispa.Views.TableView.TableView::_selectedRow(), Vispa.Views.TableView.TableView::itemSelectionChanged(), Vispa.Views.TableView.TableView::select(), and Vispa.Views.TableView.TableView::selection().

282  {
283  if (e.discarding) return;
284  std::ostringstream ost;
285  ost << n << ' ';
286  if ( (e.hexTrigger >= 0) && (n >= e.hexTrigger) ) {
287  ost << "[0x"
288  << std::hex << std::setw(4) << std::setfill('0')
289  << n << "] ";
290  }
291  msg.emitToken( ost.str() );
292 }
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
void edm::service::ELtsErrorLog::item ( const ELstring s)

Definition at line 202 of file ELtsErrorLog.cc.

References edm::ELunspecified, edm::ErrorObj::emitToken(), initiateMsg(), msg, and msgIsActive.

Referenced by Vispa.Views.TableView.TableView::_selectedRow(), Vispa.Views.TableView.TableView::itemSelectionChanged(), Vispa.Views.TableView.TableView::select(), and Vispa.Views.TableView.TableView::selection().

202  {
203  if ( ! msgIsActive )
204  initiateMsg ( ELunspecified, "..." );
205  msg.emitToken( s );
206 } // emitToken()
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
ELslProxy< ELunspecifiedGen > const ELunspecified
void initiateMsg(const ELseverityLevel &sev, const ELstring &id)
ELtsErrorLog & edm::service::ELtsErrorLog::operator= ( const ELtsErrorLog other)

Definition at line 109 of file ELtsErrorLog.cc.

References swap(), and groupFilesInBlocks::temp.

110 {
111  ELtsErrorLog temp(other);
112  this->swap(temp);
113  return *this;
114 }
void swap(ELtsErrorLog &)
bool edm::service::ELtsErrorLog::pokeMsg ( edm::ErrorObj msg)
protected

Definition at line 298 of file ELtsErrorLog.cc.

References e, edm::ELextendedID::module, edm::service::ErrorLog::module, edm::ELextendedID::process, process, edm::ErrorObj::setModule(), edm::ErrorObj::setProcess(), edm::ErrorObj::setSubroutine(), edm::ELextendedID::subroutine, edm::service::ErrorLog::subroutine, and edm::ErrorObj::xid().

298  {
299 
300  // ----- will we need to poke/restore info into the message?
301  //
302  bool updateProcess ( msg.xid().process .length() == 0 );
303  bool updateModule ( msg.xid().module .length() == 0 );
304  bool updateSubroutine( msg.xid().subroutine.length() == 0 );
305 
306  // ----- poke, if needed:
307  //
308  if ( updateProcess ) msg.setProcess ( process );
309  if ( updateModule ) msg.setModule ( e.module );
310  if ( updateSubroutine ) msg.setSubroutine( e.subroutine );
311 
312  return ( updateProcess || updateModule || updateSubroutine );
313 
314 }
virtual void setSubroutine(const ELstring &subroutine)
Definition: ErrorObj.cc:193
const ELextendedID & xid() const
Definition: ErrorObj.cc:146
ELstring subroutine
Definition: ELextendedID.h:38
virtual void setProcess(const ELstring &proc)
Definition: ErrorObj.cc:203
virtual void setModule(const ELstring &module)
Definition: ErrorObj.cc:188
void edm::service::ELtsErrorLog::setDebugMessages ( ELseverityLevel  sev,
ELstring  id 
)
protected

Definition at line 148 of file ELtsErrorLog.cc.

References e, and edm::service::ErrorLog::setDebugMessages().

148  {
149  e.setDebugMessages (sev, id);
150 }
void setDebugMessages(ELseverityLevel sev, ELstring id)
Definition: ErrorLog.cc:336
void edm::service::ELtsErrorLog::setDebugVerbosity ( int  debugVerbosity)
protected

Definition at line 144 of file ELtsErrorLog.cc.

References e, and edm::service::ErrorLog::setDebugVerbosity().

144  {
146 }
void setDebugVerbosity(int debugVerbosity)
Definition: ErrorLog.cc:332
ELseverityLevel edm::service::ELtsErrorLog::setDiscardThreshold ( ELseverityLevel  sev)
protected

Definition at line 140 of file ELtsErrorLog.cc.

References e, and edm::service::ErrorLog::setDiscardThreshold().

140  {
141  return e.setDiscardThreshold(sev);
142 }
ELseverityLevel setDiscardThreshold(ELseverityLevel sev)
Definition: ErrorLog.cc:326
int edm::service::ELtsErrorLog::setHexTrigger ( int  trigger)
protected

Definition at line 136 of file ELtsErrorLog.cc.

References e, and edm::service::ErrorLog::setHexTrigger().

136  {
137  return e.setHexTrigger (trigger);
138 }
int setHexTrigger(int trigger)
Definition: ErrorLog.cc:320
void edm::service::ELtsErrorLog::setModule ( const ELstring modName)
protected

Definition at line 124 of file ELtsErrorLog.cc.

References e, and edm::service::ErrorLog::setModule().

124  {
125  e.setModule (modName);
126 } // setModule()
void setModule(const ELstring &modName)
Definition: ErrorLog.cc:236
void edm::service::ELtsErrorLog::setPackage ( const ELstring pkgName)
protected

Definition at line 128 of file ELtsErrorLog.cc.

References e, and edm::service::ErrorLog::setModule().

128  {
129  e.setModule (pkgName);
130 } // setPackage()
void setModule(const ELstring &modName)
Definition: ErrorLog.cc:236
void edm::service::ELtsErrorLog::setProcess ( const ELstring procName)
protected

Definition at line 132 of file ELtsErrorLog.cc.

References process.

132  {
133  process = procName;
134 } // setProcess()
void edm::service::ELtsErrorLog::setSubroutine ( const ELstring subName)
protected

Definition at line 120 of file ELtsErrorLog.cc.

References e, and edm::service::ErrorLog::setSubroutine().

120  {
121  e.setSubroutine (subName);
122 } // setSubroutine()
void setSubroutine(const ELstring &subName)
Definition: ErrorLog.cc:149
void edm::service::ELtsErrorLog::swap ( ELtsErrorLog other)

Definition at line 100 of file ELtsErrorLog.cc.

References a, e, msg, msgIsActive, process, edm::ErrorObj::swap(), and std::swap().

Referenced by operator=(), and edm::service::swap().

101 {
102  std::swap(a, other.a);
103  std::swap(e, other.e);
104  process.swap(other.process);
105  std::swap(msgIsActive, other.msgIsActive);
106  msg.swap(other.msg);
107 }
void swap(ErrorObj &other)
Definition: ErrorObj.cc:126
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Data Documentation

ELadministrator* edm::service::ELtsErrorLog::a
protected

Definition at line 101 of file ELtsErrorLog.h.

Referenced by dispatch(), getELdestControl(), and swap().

ErrorLog edm::service::ELtsErrorLog::e
protected
edm::ErrorObj edm::service::ELtsErrorLog::msg
protected

Definition at line 105 of file ELtsErrorLog.h.

Referenced by initiateMsg(), item(), and swap().

bool edm::service::ELtsErrorLog::msgIsActive
protected

Definition at line 104 of file ELtsErrorLog.h.

Referenced by initiateMsg(), item(), and swap().

ELstring edm::service::ELtsErrorLog::process
protected