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 | Private Member Functions | Friends
edm::service::ELcollected Class Reference

#include <ELcollected.h>

Inheritance diagram for edm::service::ELcollected:
edm::service::ELoutput edm::service::ELdestination

Public Member Functions

virtual ELcollectedclone () const
 
 ELcollected (const ELsender &sender)
 
 ELcollected (const ELcollected &orig)
 
 ELcollected (ELoutput *d)
 
virtual bool log (const edm::ErrorObj &msg)
 
virtual ~ELcollected ()
 
- Public Member Functions inherited from edm::service::ELoutput
 ELoutput ()
 
 ELoutput (std::ostream &os, bool emitAtStart=false)
 
 ELoutput (const ELstring &fileName, bool emitAtStart=false)
 
 ELoutput (const ELoutput &orig)
 
virtual ~ELoutput ()
 
- Public Member Functions inherited from edm::service::ELdestination
 ELdestination ()
 
virtual void finish ()
 
virtual ELstring getNewline () const
 
virtual ~ELdestination ()
 

Protected Member Functions

void emitToken (const ELstring &s, bool nl=false)
 
void emitXid (const ELextendedID &xid)
 
void intoBuf (const ELstring &s)
 
- Protected Member Functions inherited from edm::service::ELoutput
virtual void attachEpilogue ()
 
virtual void attachTime ()
 
virtual void changeFile (std::ostream &os)
 
virtual void changeFile (const ELstring &filename)
 
virtual void flush ()
 
virtual void includeContext ()
 
virtual void includeModule ()
 
virtual void includeSerial ()
 
virtual void includeSubroutine ()
 
virtual void includeText ()
 
virtual void includeTime ()
 
ELoutputoperator= (const ELoutput &orig)
 
virtual void separateEpilogue ()
 
virtual void separateTime ()
 
virtual void summarization (const ELstring &fullTitle, const ELstring &sumLines)
 
virtual void suppressContext ()
 
virtual void suppressModule ()
 
virtual void suppressSerial ()
 
virtual void suppressSubroutine ()
 
virtual void suppressText ()
 
virtual void suppressTime ()
 
virtual void useContext ()
 
virtual void useFullContext ()
 
- Protected Member Functions inherited from edm::service::ELdestination
virtual void clearSummary ()
 
virtual void excludeModule (ELstring const &moduleName)
 
virtual void filterModule (ELstring const &moduleName)
 
virtual void ignoreModule (ELstring const &moduleName)
 
virtual void respondToModule (ELstring const &moduleName)
 
virtual void setTableLimit (int n)
 
virtual std::map< ELextendedID,
StatsCount
statisticsMap () const
 
virtual void summary (ELdestControl &dest, const ELstring &title="")
 
virtual void summary (std::ostream &os, const ELstring &title="")
 
virtual void summary (ELstring &s, const ELstring &title="")
 
virtual void summary ()
 
virtual void summaryForJobReport (std::map< std::string, double > &sm)
 
virtual bool thisShouldBeIgnored (const ELstring &s) const
 
virtual void wipe ()
 
virtual void zero ()
 

Protected Attributes

ELstring buf
 
boost::shared_ptr< ELsendersender
 
- Protected Attributes inherited from edm::service::ELoutput
int charsOnLine
 
boost::shared_ptr< std::ostream > os
 
bool preambleMode
 
bool wantEpilogueSeparate
 
bool wantFullContext
 
bool wantModule
 
bool wantSerial
 
bool wantSomeContext
 
bool wantSubroutine
 
bool wantText
 
bool wantTimeSeparate
 
bool wantTimestamp
 
edm::ELextendedID xid
 
- Protected Attributes inherited from edm::service::ELdestination
bool ignoreMostModules
 
ELset_string ignoreThese
 
ELstring indent
 
ELlimitsTable limits
 
int lineLength
 
ELstring newline
 
ELstring preamble
 
bool respondToMostModules
 
ELset_string respondToThese
 
ELseverityLevel threshold
 
ELseverityLevel traceThreshold
 

Private Member Functions

ELcollectedoperator= (const ELcollected &orig)
 

Friends

class ELdestControl
 

Additional Inherited Members

- Static Protected Attributes inherited from edm::service::ELdestination
static const int defaultLineLength = 80
 

Detailed Description

Definition at line 91 of file ELcollected.h.

Constructor & Destructor Documentation

edm::service::ELcollected::ELcollected ( const ELsender sender)

Definition at line 37 of file ELcollected.cc.

References gather_cfg::cout.

Referenced by clone().

38 : ELoutput()
39 , sender ( snd.clone() )
40 {
41 
42  #ifdef ELcollectedCONSTRUCTOR_TRACE
43  std::cout << "Constructor for ELcollected(ELsender)\n";
44  #endif
45 
46  // Unlike ELoutput, we do not emit Error Log established message.
47 
48 } // ELcollected()
boost::shared_ptr< ELsender > sender
Definition: ELcollected.h:136
tuple cout
Definition: gather_cfg.py:121
edm::service::ELcollected::ELcollected ( const ELcollected orig)

Definition at line 51 of file ELcollected.cc.

References gather_cfg::cout, edm::service::ELdestination::ignoreMostModules, edm::service::ELdestination::ignoreThese, edm::service::ELdestination::respondToMostModules, and edm::service::ELdestination::respondToThese.

52 : ELoutput( orig )
53 , sender ( orig.sender->clone() ) // $$ mf 9/15/00
54 {
55 
56  #ifdef ELcollectedCONSTRUCTOR_TRACE
57  std::cout << "Copy constructor for ELcollected\n";
58  #endif
59 
60  ignoreMostModules = orig.ignoreMostModules;
61  respondToThese = orig.respondToThese;
62  respondToMostModules = orig.respondToMostModules;
63  ignoreThese = orig.ignoreThese;
64 
65 } // ELcollected()
boost::shared_ptr< ELsender > sender
Definition: ELcollected.h:136
tuple cout
Definition: gather_cfg.py:121
edm::service::ELcollected::ELcollected ( ELoutput d)
edm::service::ELcollected::~ELcollected ( )
virtual

Definition at line 68 of file ELcollected.cc.

References gather_cfg::cout.

68  {
69 
70  #ifdef ELcollectedCONSTRUCTOR_TRACE
71  std::cout << "Destructor for ELcollected)\n";
72  #endif
73 } // ~ELcollected()
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

ELcollected * edm::service::ELcollected::clone ( void  ) const
virtual

Reimplemented from edm::service::ELoutput.

Definition at line 82 of file ELcollected.cc.

References ELcollected().

82  {
83 
84  return new ELcollected( *this );
85 
86 } // clone()
ELcollected(const ELsender &sender)
Definition: ELcollected.cc:37
void edm::service::ELcollected::emitToken ( const ELstring s,
bool  nl = false 
)
protectedvirtual

Reimplemented from edm::service::ELoutput.

Definition at line 126 of file ELcollected.cc.

References edm::service::ELoutput::charsOnLine, gather_cfg::cout, intoBuf(), and edm::service::ELdestination::newline.

Referenced by log().

126  {
127 
128  #ifdef ELcollected_EMIT_TRACE
129  std::cout << "[][][] in emit: s.length() " << s.length() << "\n";
130  #endif
131 
132  // A forced newline is something that needs to be transmitted.
133  // We shall insert it as its own item.
134 
135  if (s.length() == 0) {
136  if ( nl ) {
137  intoBuf( newline );
138  charsOnLine = 0;
139  }
140  return;
141  }
142 
143  // Setting up for indentation if you start with a nweline, or if the length
144  // exceeds column 80, is not done here, it is done on the server.
145 
146  #ifdef ELcollected_EMIT_TRACE
147  std::cout << "[][][] in emit: about to << s to buf: " << s << " \n";
148  #endif
149 
150  // Place the item into the buffer
151 
152  intoBuf (s);
153 
154  // Accounting for trailing \n is done at the server.
155 
156  // A forced trailing newline is something that needs to be transmitted.
157  // We shall insert it as its own item.
158 
159  if ( nl ) {
160  intoBuf (newline);
161  }
162 
163  #ifdef ELcollected_EMIT_TRACE
164  std::cout << "[][][] in emit: completed \n";
165  #endif
166 
167 } // emitToken()
void intoBuf(const ELstring &s)
Definition: ELcollected.cc:95
tuple cout
Definition: gather_cfg.py:121
void edm::service::ELcollected::emitXid ( const ELextendedID xid)
protected

Definition at line 107 of file ELcollected.cc.

References buf, edm::ELseverityLevel::getLevel(), edm::ELextendedID::id, intoBuf(), edm::ELextendedID::module, edm::ELextendedID::process, edm::ELextendedID::severity, and edm::ELextendedID::subroutine.

Referenced by log().

107  {
108 
109  buf = "";
110 
111  intoBuf ( xid.process );
112  intoBuf ( xid.module );
113  intoBuf ( xid.subroutine );
114  intoBuf ( xid.id );
115  std::ostringstream ost;
116  ost << xid.severity.getLevel();
117  intoBuf ( ost.str() );
118 
119 } // emitXid
ELseverityLevel severity
Definition: ELextendedID.h:36
edm::ELextendedID xid
Definition: ELoutput.h:115
void intoBuf(const ELstring &s)
Definition: ELcollected.cc:95
ELstring subroutine
Definition: ELextendedID.h:38
void edm::service::ELcollected::intoBuf ( const ELstring s)
protected

Definition at line 95 of file ELcollected.cc.

References buf, and alignCSCRings::s.

Referenced by emitToken(), and emitXid().

95  {
96 
97  buf += s;
98  buf += '\0';
99 
100 } // intoBuf();
bool edm::service::ELcollected::log ( const edm::ErrorObj msg)
virtual

Reimplemented from edm::service::ELoutput.

Definition at line 175 of file ELcollected.cc.

References edm::service::ELlimitsTable::add(), buf, gather_cfg::cout, emitToken(), emitXid(), edm::service::ELadministrator::instance(), edm::ErrorObj::items(), edm::service::ELdestination::limits, edm::ELextendedID::module, sender, edm::ELextendedID::severity, edm::service::ELdestination::thisShouldBeIgnored(), edm::service::ELdestination::threshold, edm::service::ELdestination::traceThreshold, edm::service::ELoutput::wantText, edm::ErrorObj::xid(), and edm::service::ELoutput::xid.

175  {
176 
177  #ifdef ELcollectedTRACE_LOG
178  std::cout << " =:=:=: Log to an ELcollected \n";
179  #endif
180 
181  xid = msg.xid(); // Save the xid.
182 
183  // See if this message is to be acted upon, and add it to limits table
184  // if it was not already present:
185  //
186  if ( msg.xid().severity < threshold ) return false;
187  if ( thisShouldBeIgnored(xid.module) ) return false;
188  if ( ! limits.add( msg.xid() ) ) return false;
189 
190  #ifdef ELcollectedTRACE_LOG
191  std::cout << " =:=:=: Limits table work done \n";
192  #endif
193 
194  // start the buffer with the xid
195 
196  emitXid (xid);
197 
198  //
199 
200  #ifdef ELcollectedTRACE_LOG
201  std::cout << " =:=:=: xid emitted \n";
202  #endif
203 
204  // Provide the context information. The server side will use this to prime
205  // its special context supplier. We will send over all three types of
206  // context, even though probably only 1 or 2 will be needed.
207 
209  getContextSupplier().summaryContext());
211  getContextSupplier().context());
213  getContextSupplier().fullContext());
214 
215  #ifdef ELcollectedTRACE_LOG
216  std::cout << " =:=:=: Context done: \n";
217  #endif
218 
219  // No prologue separate from what the server will issue.
220 
221  // No serial number of message separate from what the server will issue.
222 
223  // collected each item in the message:
224  //
225  if ( wantText ) {
226  ELlist_string::const_iterator it;
227  for ( it = msg.items().begin(); it != msg.items().end(); ++it ) {
228  #ifdef ELcollectedTRACE_LOG
229  std::cout << " =:=:=: Item: " << *it <<"\n";
230  #endif
231  emitToken( *it );
232  }
233  }
234 
235  // DO NOT Provide further identification such as module and subroutine;
236  // the server side will provide that using the xid you have sent it, if
237  // the server side user wants it.
238 
239  // DO NOT provide time stamp; it would duplicate server's stamp!
240 
241  // Provide traceback information:
242  //
243  if ( msg.xid().severity >= traceThreshold ) {
244  emitToken( ELstring("\n")
245  + ELadministrator::instance()->getContextSupplier().traceRoutine()
246  , true );
247  }
248  else { //else statement added JV:1
249  emitToken( "", true );
250  }
251  #ifdef ELcollectedTRACE_LOG
252  std::cout << " =:=:=: Trace routine done: \n";
253  #endif
254 
255  // Message has been fully processed through emit; now put in an extra
256  // zero, and send out the buffer.
257  //
258 
259  buf += char(0);
260  int nbuf = buf.length();
261 
262  sender->send ( nbuf, buf.data() );
263 
264  #ifdef ELcollectedTRACE_LOG
265  std::cout << " =:=:=: log(msg) done: \n";
266  #endif
267 
268  return true;
269 
270 } // log()
ELseverityLevel traceThreshold
ELseverityLevel severity
Definition: ELextendedID.h:36
boost::shared_ptr< ELsender > sender
Definition: ELcollected.h:136
virtual bool thisShouldBeIgnored(const ELstring &s) const
void emitToken(const ELstring &s, bool nl=false)
Definition: ELcollected.cc:126
edm::ELextendedID xid
Definition: ELoutput.h:115
const ELextendedID & xid() const
Definition: ErrorObj.cc:146
bool add(const ELextendedID &xid)
void emitXid(const ELextendedID &xid)
Definition: ELcollected.cc:107
const ELlist_string & items() const
Definition: ErrorObj.cc:149
static ELadministrator * instance()
tuple cout
Definition: gather_cfg.py:121
std::string ELstring
Definition: ELstring.h:26
ELcollected& edm::service::ELcollected::operator= ( const ELcollected orig)
private

Friends And Related Function Documentation

friend class ELdestControl
friend

Definition at line 93 of file ELcollected.h.

Member Data Documentation

ELstring edm::service::ELcollected::buf
protected

Definition at line 141 of file ELcollected.h.

Referenced by emitXid(), intoBuf(), and log().

boost::shared_ptr<ELsender> edm::service::ELcollected::sender
protected