CMS 3D CMS Logo

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

#include <ErrorLog.h>

Public Member Functions

ErrorLogemitToken (const ELstring &msg)
 
ErrorLogendmsg ()
 
 ErrorLog ()
 
 ErrorLog (const ELstring &pkgName)
 
bool getELdestControl (const ELstring &name, ELdestControl &theDestControl) const
 
ELstring moduleName () const
 
ErrorLogoperator() (const ELseverityLevel &sev, const ELstring &id)
 
ErrorLogoperator() (int debugLevel)
 
ErrorLogoperator() (edm::ErrorObj &msg)
 
ErrorLogoperator() (int nbytes, char *data)
 
ErrorLogoperator<< (void(*f)(ErrorLog &))
 
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)
 
bool setSpaceAfterInt (bool space=true)
 
void setSubroutine (const ELstring &subName)
 
ELstring subroutineName () const
 
virtual ~ErrorLog ()
 

Public Attributes

ELstring debugMessageId
 
ELseverityLevel debugSeverityLevel
 
int debugVerbosityLevel
 
bool discarding
 
ELseverityLevel discardThreshold
 
int hexTrigger
 
bool spaceAfterInt
 

Protected Attributes

ELadministratora
 

Private Attributes

ELstring module
 
ELstring subroutine
 

Friends

class ELtsErrorLog
 

Detailed Description

Definition at line 51 of file ErrorLog.h.

Constructor & Destructor Documentation

edm::service::ErrorLog::ErrorLog ( )

Definition at line 69 of file ErrorLog.cc.

References gather_cfg::cout.

71 , subroutine( "" )
72 , module( "" )
73 , hexTrigger(-1)
74 , spaceAfterInt(false)
76 , discarding (false)
79 , debugMessageId ("DEBUG")
80 {
81 
82  #ifdef ErrorLogCONSTRUCTOR_TRACE
83  std::cout << "Constructor for ErrorLog\n";
84  #endif
85 
86 } // ErrorLog()
ELseverityLevel discardThreshold
Definition: ErrorLog.h:129
ELslProxy< ELzeroSeverityGen > const ELzeroSeverity
ELslProxy< ELinfoGen > const ELinfo
ELseverityLevel debugSeverityLevel
Definition: ErrorLog.h:132
static ELadministrator * instance()
ELadministrator * a
Definition: ErrorLog.h:121
ELstring debugMessageId
Definition: ErrorLog.h:133
tuple cout
Definition: gather_cfg.py:121
edm::service::ErrorLog::ErrorLog ( const ELstring pkgName)

Definition at line 88 of file ErrorLog.cc.

References gather_cfg::cout.

90 , subroutine( "" )
91 , module( pkgName )
92 , hexTrigger(-1)
93 , spaceAfterInt(false)
95 , discarding (false)
98 , debugMessageId ("DEBUG")
99 {
100 
101  #ifdef ErrorLogCONSTRUCTOR_TRACE
102  std::cout << "Constructor for ErrorLog (with pkgName = " << pkgName << ")\n";
103  #endif
104 
105 } // ErrorLog()
ELseverityLevel discardThreshold
Definition: ErrorLog.h:129
ELslProxy< ELzeroSeverityGen > const ELzeroSeverity
ELslProxy< ELinfoGen > const ELinfo
ELseverityLevel debugSeverityLevel
Definition: ErrorLog.h:132
static ELadministrator * instance()
ELadministrator * a
Definition: ErrorLog.h:121
ELstring debugMessageId
Definition: ErrorLog.h:133
tuple cout
Definition: gather_cfg.py:121
edm::service::ErrorLog::~ErrorLog ( )
virtual

Definition at line 108 of file ErrorLog.cc.

References gather_cfg::cout.

108  {
109 
110  #ifdef ErrorLogCONSTRUCTOR_TRACE
111  std::cout << "Destructor for ErrorLog\n";
112  #endif
113 
114 } // ~ErrorLog()
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

ErrorLog & edm::service::ErrorLog::emitToken ( const ELstring msg)

Definition at line 269 of file ErrorLog.cc.

References a, gather_cfg::cout, edm::ELunspecified, edm::ErrorObj::emitToken(), edm::service::ELadministrator::msg, and edm::service::ELadministrator::msgIsActive.

Referenced by edm::service::operator<<().

269  {
270 
271  #ifdef ErrorLogEMIT_TRACE
272  std::cout << " =:=:=: ErrorLog emit trace: string is: " << s << "\n";
273  #endif
274 
275  if ( ! a->msgIsActive )
276  (*this) ( ELunspecified, "..." );
277 
278  a->msg.emitToken( s );
279 
280  #ifdef ErrorLogEMIT_TRACE
281  std::cout << " =:=:=: ErrorLog emit trace: return from a->msg.emitToken()\n";
282  #endif
283 
284  return *this;
285 
286 } // emitToken()
virtual ErrorObj & emitToken(const ELstring &txt)
Definition: ErrorObj.cc:220
ELslProxy< ELunspecifiedGen > const ELunspecified
ELadministrator * a
Definition: ErrorLog.h:121
tuple cout
Definition: gather_cfg.py:121
ErrorLog & edm::service::ErrorLog::endmsg ( )

Definition at line 289 of file ErrorLog.cc.

References a, edm::service::ELadministrator::clearMsg(), gather_cfg::cout, edm::service::ELadministrator::finishMsg(), and edm::service::ELadministrator::msgIsActive.

Referenced by edm::service::endmsg(), and operator()().

289  {
290 
291  #ifdef ErrorLogENDMSG_TRACE
292  std::cout << "=:=:=: endmsg () -- msgIsActive = " << a->msgIsActive
293  << std::endl;
294  #endif
295 
296  if ( a->msgIsActive ) {
297  #ifdef ErrorLogENDMSG_TRACE
298  std::cout << "=:=:=: endmsg () -- finishMsg started\n";
299  #endif
300  a->finishMsg();
301  #ifdef ErrorLogENDMSG_TRACE
302  std::cout << "=:=:=: endmsg () -- finishMsg completed\n";
303  #endif
304  a->clearMsg();
305  }
306  return *this;
307 
308 } // endmsg()
ELadministrator * a
Definition: ErrorLog.h:121
tuple cout
Definition: gather_cfg.py:121
bool edm::service::ErrorLog::getELdestControl ( const ELstring name,
ELdestControl theDestControl 
) const

Definition at line 341 of file ErrorLog.cc.

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

342  {
343  return a->getELdestControl(name, theDestControl);
344 }
bool getELdestControl(const ELstring &name, ELdestControl &theControl)
ELadministrator * a
Definition: ErrorLog.h:121
ELstring edm::service::ErrorLog::moduleName ( ) const

Definition at line 350 of file ErrorLog.cc.

References module.

350 { return module; }
ErrorLog & edm::service::ErrorLog::operator() ( const ELseverityLevel sev,
const ELstring id 
)

Definition at line 116 of file ErrorLog.cc.

References a, gather_cfg::cout, discarding, discardThreshold, endmsg(), edm::ELseverityLevel::getName(), edm::service::ELadministrator::msg, edm::service::ELadministrator::msgIsActive, edm::service::ELadministrator::process(), edm::ErrorObj::set(), edm::ErrorObj::setModule(), edm::ErrorObj::setProcess(), edm::ErrorObj::setReactedTo(), edm::ErrorObj::setSubroutine(), and subroutine.

119 {
120 
121  if ( sev < discardThreshold ) {
122  discarding = true;
123  return *this;
124  }
125 
126  discarding = false;
127 
128  #ifdef ErrorLogENDMSG_TRACE
129  std::cout << "=:=:=: precautionary endmsg ( "
130  << sev.getName() << ", " << id << ")\n";
131  #endif
132 
133  endmsg(); // precautionary
134 
135  // ----- form ErrorObj for this new message:
136  //
137  a->msgIsActive = true;
138  a->msg.set ( sev, id );
139  a->msg.setProcess ( a->process() );
140  a->msg.setModule ( module );
142  a->msg.setReactedTo ( false );
143 
144  return *this;
145 
146 } // operator()( sev, id )
ErrorLog & endmsg()
Definition: ErrorLog.cc:289
virtual void set(const ELseverityLevel &sev, const ELstring &id)
Definition: ErrorObj.cc:249
virtual void setSubroutine(const ELstring &subroutine)
Definition: ErrorObj.cc:193
const ELstring & process() const
virtual void setReactedTo(bool r)
Definition: ErrorObj.cc:210
ELseverityLevel discardThreshold
Definition: ErrorLog.h:129
ELadministrator * a
Definition: ErrorLog.h:121
virtual void setProcess(const ELstring &proc)
Definition: ErrorObj.cc:203
tuple cout
Definition: gather_cfg.py:121
Definition: vlib.h:209
virtual void setModule(const ELstring &module)
Definition: ErrorObj.cc:188
ErrorLog& edm::service::ErrorLog::operator() ( int  debugLevel)
inline
ErrorLog & edm::service::ErrorLog::operator() ( edm::ErrorObj msg)

Definition at line 180 of file ErrorLog.cc.

References a, edm::service::ELadministrator::abortThreshold(), edm::service::ELadministrator::attach(), dtNoiseDBValidation_cfg::cerr, edm::service::ELadministrator::context_, gather_cfg::cout, endmsg(), edm::service::ELadministrator::exitThreshold(), edm::ELseverityLevel::getLevel(), edm::service::ELadministrator::highSeverity_, edm::ELextendedID::module, edm::service::possiblyAbOrEx(), edm::ELextendedID::process, edm::service::ELadministrator::process(), edm::ErrorObj::setModule(), edm::ErrorObj::setProcess(), edm::ErrorObj::setReactedTo(), edm::ErrorObj::setSubroutine(), edm::ELextendedID::severity, edm::service::ELadministrator::severityCounts_, edm::service::ELadministrator::sinks(), edm::ELextendedID::subroutine, subroutine, and edm::ErrorObj::xid().

180  {
181 
182  #ifdef ErrorLogENDMSG_TRACE
183  std::cout << "=:=:=: precautionary endmsg called from operator() (msg) \n";
184  #endif
185 
186  endmsg(); // precautionary
187 
188  // ----- will we need to poke/restore info into the message?
189  //
190  bool updateProcess ( msg.xid().process .length() == 0 );
191  bool updateModule ( msg.xid().module .length() == 0 );
192  bool updateSubroutine( msg.xid().subroutine.length() == 0 );
193 
194  // ----- poke, if needed:
195  //
196  if ( updateProcess ) msg.setProcess ( a->process() );
197  if ( updateModule ) msg.setModule ( module );
198  if ( updateSubroutine ) msg.setSubroutine( subroutine );
199 
200  // severity level statistics keeping: // $$ mf 6/7/01
201  int lev = msg.xid().severity.getLevel();
202  ++ a->severityCounts_[lev];
203  if ( lev > a->highSeverity_.getLevel() )
204  a->highSeverity_ = msg.xid().severity;
205 
206  a->context_->editErrorObj( msg );
207 
208  // ----- send the message to each destination:
209  //
210  if (a->sinks().begin() == a->sinks().end()) {
211  std::cerr << "\nERROR LOGGED WITHOUT DESTINATION!\n";
212  std::cerr << "Attaching destination \"cerr\" to ELadministrator by default\n"
213  << std::endl;
214  a->attach(ELoutput(std::cerr));
215  }
216  std::list<boost::shared_ptr<ELdestination> >::iterator d;
217  for ( d = a->sinks().begin(); d != a->sinks().end(); ++d )
218  if ( (*d)->log( msg ) )
219  msg.setReactedTo ( true );
220 
223  a->exitThreshold().getLevel() ); // $$ mf 3/17/04
224 
225  // ----- restore, if we poked above:
226  //
227  if ( updateProcess ) msg.setProcess( "" );
228  if ( updateModule ) msg.setModule( "" );
229  if ( updateSubroutine ) msg.setSubroutine( "" );
230 
231  return *this;
232 
233 } // operator()( )
ELseverityLevel severity
Definition: ELextendedID.h:36
std::list< boost::shared_ptr< ELdestination > > & sinks()
ErrorLog & endmsg()
Definition: ErrorLog.cc:289
int severityCounts_[ELseverityLevel::nLevels]
virtual void setSubroutine(const ELstring &subroutine)
Definition: ErrorObj.cc:193
const ELstring & process() const
virtual void setReactedTo(bool r)
Definition: ErrorObj.cc:210
const ELextendedID & xid() const
Definition: ErrorObj.cc:146
static void possiblyAbOrEx(int s, int a, int e)
Definition: ErrorLog.cc:169
boost::shared_ptr< ELcontextSupplier > context_
ELstring subroutine
Definition: ELextendedID.h:38
ELadministrator * a
Definition: ErrorLog.h:121
virtual void setProcess(const ELstring &proc)
Definition: ErrorObj.cc:203
tuple cout
Definition: gather_cfg.py:121
ELdestControl attach(const ELdestination &sink)
const ELseverityLevel & exitThreshold() const
Definition: vlib.h:209
const ELseverityLevel & abortThreshold() const
virtual void setModule(const ELstring &module)
Definition: ErrorObj.cc:188
ErrorLog & edm::service::ErrorLog::operator() ( int  nbytes,
char *  data 
)

Definition at line 250 of file ErrorLog.cc.

References edm::service::ELrecv().

250  {
251 
252  ELrecv ( nbytes, data, module );
253  return *this;
254 
255 } // operator() (nbytes, data)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void ELrecv(int nbytes, const char *data)
Definition: ELrecv.cc:42
Definition: vlib.h:209
ErrorLog & edm::service::ErrorLog::operator<< ( void(*)(ErrorLog &)  f)

Definition at line 257 of file ErrorLog.cc.

References gather_cfg::cout, discarding, and f.

257  {
258  #ifdef ErrorLogOUTPUT_TRACE
259  std::cout << "=:=:=: ErrorLog output trace: f at " << std::hex << f
260  << std::endl;
261  #endif
262  if (discarding) return *this;
263  f( *this );
264  return *this;
265 
266 } // operator<<()
double f[11][100]
tuple cout
Definition: gather_cfg.py:121
void edm::service::ErrorLog::setDebugMessages ( ELseverityLevel  sev,
ELstring  id 
)
void edm::service::ErrorLog::setDebugVerbosity ( int  debugVerbosity)
ELseverityLevel edm::service::ErrorLog::setDiscardThreshold ( ELseverityLevel  sev)

Definition at line 326 of file ErrorLog.cc.

References discardThreshold.

Referenced by edm::service::ELtsErrorLog::setDiscardThreshold().

326  {
327  ELseverityLevel oldSev = discardThreshold;
328  discardThreshold = sev;
329  return oldSev;
330 }
ELseverityLevel discardThreshold
Definition: ErrorLog.h:129
int edm::service::ErrorLog::setHexTrigger ( int  trigger)

Definition at line 320 of file ErrorLog.cc.

References hexTrigger.

Referenced by edm::service::ELtsErrorLog::setHexTrigger().

320  {
321  int oldTrigger = hexTrigger;
322  hexTrigger = trigger;
323  return oldTrigger;
324 }
void edm::service::ErrorLog::setModule ( const ELstring modName)

Definition at line 236 of file ErrorLog.cc.

Referenced by edm::service::ELrecv(), edm::service::ELtsErrorLog::setModule(), edm::service::ELtsErrorLog::setPackage(), and setPackage().

236  {
237 
238  module = modName;
239 
240 } // setModule()
Definition: vlib.h:209
void edm::service::ErrorLog::setPackage ( const ELstring pkgName)

Definition at line 243 of file ErrorLog.cc.

References setModule().

243  {
244 
245  setModule( pkgName );
246 
247 } // setPackage()
void setModule(const ELstring &modName)
Definition: ErrorLog.cc:236
bool edm::service::ErrorLog::setSpaceAfterInt ( bool  space = true)

Definition at line 314 of file ErrorLog.cc.

References spaceAfterInt, and groupFilesInBlocks::temp.

314  {
315  bool temp = spaceAfterInt;
316  spaceAfterInt = space;
317  return temp;
318 }
void edm::service::ErrorLog::setSubroutine ( const ELstring subName)

Definition at line 149 of file ErrorLog.cc.

References subroutine.

Referenced by edm::service::ELrecv(), and edm::service::ELtsErrorLog::setSubroutine().

149  {
150 
151  subroutine = subName;
152 
153 } // setSubroutine()
ELstring edm::service::ErrorLog::subroutineName ( ) const

Definition at line 351 of file ErrorLog.cc.

References subroutine.

351 { return subroutine; }

Friends And Related Function Documentation

friend class ELtsErrorLog
friend

Definition at line 53 of file ErrorLog.h.

Member Data Documentation

ELadministrator* edm::service::ErrorLog::a
protected

Definition at line 121 of file ErrorLog.h.

Referenced by emitToken(), endmsg(), getELdestControl(), and operator()().

ELstring edm::service::ErrorLog::debugMessageId

Definition at line 133 of file ErrorLog.h.

Referenced by setDebugMessages().

ELseverityLevel edm::service::ErrorLog::debugSeverityLevel

Definition at line 132 of file ErrorLog.h.

Referenced by setDebugMessages().

int edm::service::ErrorLog::debugVerbosityLevel

Definition at line 131 of file ErrorLog.h.

Referenced by setDebugVerbosity().

bool edm::service::ErrorLog::discarding
ELseverityLevel edm::service::ErrorLog::discardThreshold
int edm::service::ErrorLog::hexTrigger
ELstring edm::service::ErrorLog::module
private
bool edm::service::ErrorLog::spaceAfterInt

Definition at line 128 of file ErrorLog.h.

Referenced by edm::service::operator<<(), and setSpaceAfterInt().

ELstring edm::service::ErrorLog::subroutine
private