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 | Friends
edm::service::ELoutput Class Reference

#include <ELoutput.h>

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

Public Member Functions

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

Protected Member Functions

virtual void attachEpilogue ()
 
virtual void attachTime ()
 
virtual void changeFile (std::ostream &os)
 
virtual void changeFile (const ELstring &filename)
 
virtual void emitToken (const ELstring &s, bool nl=false)
 
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

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
 

Friends

class ELdestControl
 

Additional Inherited Members

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

Detailed Description

Definition at line 49 of file ELoutput.h.

Constructor & Destructor Documentation

edm::service::ELoutput::ELoutput ( )

Definition at line 127 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr, and emitToken().

Referenced by clone().

128 : ELdestination ( )
129 , os ( &std::cerr, do_nothing_deleter() )
130 , charsOnLine ( 0 )
131 , xid ( )
132 , wantTimestamp ( true )
133 , wantModule ( true )
134 , wantSubroutine ( true )
135 , wantText ( true )
136 , wantSomeContext ( true )
137 , wantSerial ( false )
138 , wantFullContext ( false )
139 , wantTimeSeparate ( false )
140 , wantEpilogueSeparate( false )
141 , preambleMode ( true ) // 006 9/2/10 mf
142 {
143 
144  #ifdef ELoutputCONSTRUCTOR_TRACE
145  std::cerr << "Constructor for ELoutput()\n";
146  #endif
147 
148  emitToken( "\n=================================================", true );
149  emitToken( "\nMessage Log File written by MessageLogger service \n" );
150  emitToken( "\n=================================================\n", true );
151 
152 } // ELoutput()
edm::ELextendedID xid
Definition: ELoutput.h:115
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:544
edm::service::ELoutput::ELoutput ( std::ostream &  os,
bool  emitAtStart = false 
)

Definition at line 155 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr, emitToken(), and preambleMode.

156 : ELdestination ( )
157 , os ( &os_, do_nothing_deleter() )
158 , charsOnLine ( 0 )
159 , xid ( )
160 , wantTimestamp ( true )
161 , wantModule ( true )
162 , wantSubroutine ( true )
163 , wantText ( true )
164 , wantSomeContext ( true )
165 , wantSerial ( false )
166 , wantFullContext ( false )
167 , wantTimeSeparate ( false )
168 , wantEpilogueSeparate( false )
169 , preambleMode ( true ) // 006 9/2/10 mf
170 {
171 
172  #ifdef ELoutputCONSTRUCTOR_TRACE
173  std::cerr << "Constructor for ELoutput( os )\n";
174  #endif
175 
176  // Enh 001 2/13/01 mf
177  if (emitAtStart) {
178  preambleMode = true;
179  emitToken( "\n=================================================", true );
180  emitToken( "\nMessage Log File written by MessageLogger service \n" );
181  emitToken( "\n=================================================\n", true );
182  }
183 
184 } // ELoutput()
edm::ELextendedID xid
Definition: ELoutput.h:115
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:544
edm::service::ELoutput::ELoutput ( const ELstring fileName,
bool  emitAtStart = false 
)

Definition at line 187 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr, emitToken(), edm::service::formatTime(), os, preambleMode, and cond::rpcobgas::time.

188 : ELdestination ( )
189 , os ( new std::ofstream( fileName.c_str() , std::ios/*_base*/::app), close_and_delete())
190 , charsOnLine ( 0 )
191 , xid ( )
192 , wantTimestamp ( true )
193 , wantModule ( true )
194 , wantSubroutine ( true )
195 , wantText ( true )
196 , wantSomeContext ( true )
197 , wantSerial ( false )
198 , wantFullContext ( false )
199 , wantTimeSeparate ( false )
200 , wantEpilogueSeparate( false )
201 , preambleMode ( true ) // 006 9/2/10 mf
202 {
203 
204  #ifdef ELoutputCONSTRUCTOR_TRACE
205  std::cerr << "Constructor for ELoutput( " << fileName << " )\n";
206  #endif
207 
208  preambleMode = true;
209  if ( os && *os ) {
210  #ifdef ELoutputCONSTRUCTOR_TRACE
211  std::cerr << " Testing if os is owned\n";
212  #endif
213  #ifdef ELoutputCONSTRUCTOR_TRACE
214  std::cerr << " About to do first emit\n";
215  #endif
216  // Enh 001 2/13/01 mf
217  if (emitAtStart) {
218  emitToken( "\n=======================================================",
219  true );
220  emitToken( "\nError Log File " );
221  emitToken( fileName );
222  emitToken( " \n" );
223  }
224  }
225  else {
226  #ifdef ELoutputCONSTRUCTOR_TRACE
227  std::cerr << " Deleting os\n";
228  #endif
229  os.reset(&std::cerr, do_nothing_deleter());
230  #ifdef ELoutputCONSTRUCTOR_TRACE
231  std::cerr << " about to emit to cerr\n";
232  #endif
233  if (emitAtStart) {
234  emitToken( "\n=======================================================",
235  true );
236  emitToken( "\n%MSG** Logging to cerr is being substituted" );
237  emitToken( " for specified log file \"" );
238  emitToken( fileName );
239  emitToken( "\" which could not be opened for write or append.\n" );
240  }
241  }
242  if (emitAtStart) {
243  ELstring const& ftime = formatTime(time(0)); // Change log 7
244  emitToken( ftime, true );
245  emitToken( "\n=======================================================\n",
246  true );
247  }
248  // preambleMode = tprm; removed 9/2/10 mf see change log 6
249 
250  #ifdef ELoutputCONSTRUCTOR_TRACE
251  std::cerr << "Constructor for ELoutput completed.\n";
252  #endif
253 
254 } // ELoutput()
edm::ELextendedID xid
Definition: ELoutput.h:115
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:101
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:544
std::string ELstring
Definition: ELstring.h:26
edm::service::ELoutput::ELoutput ( const ELoutput orig)

Definition at line 257 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr, edm::service::ELdestination::ignoreMostModules, edm::service::ELdestination::ignoreThese, edm::service::ELdestination::indent, edm::service::ELdestination::limits, edm::service::ELdestination::lineLength, edm::service::ELdestination::newline, edm::service::ELdestination::preamble, edm::service::ELdestination::respondToMostModules, edm::service::ELdestination::respondToThese, edm::service::ELdestination::threshold, and edm::service::ELdestination::traceThreshold.

258 : ELdestination ( )
259 , os ( orig.os )
260 , charsOnLine ( orig.charsOnLine )
261 , xid ( orig.xid )
262 , wantTimestamp ( orig.wantTimestamp )
263 , wantModule ( orig.wantModule )
264 , wantSubroutine ( orig.wantSubroutine )
265 , wantText ( orig.wantText )
266 , wantSomeContext ( orig.wantSomeContext )
267 , wantSerial ( orig.wantSerial )
268 , wantFullContext ( orig.wantFullContext )
269 , wantTimeSeparate ( orig.wantTimeSeparate )
270 , wantEpilogueSeparate( orig.wantEpilogueSeparate )
271 , preambleMode ( orig.preambleMode ) // 006 9/2/10 mf
272 {
273 
274  #ifdef ELoutputCONSTRUCTOR_TRACE
275  std::cerr << "Copy constructor for ELoutput\n";
276  #endif
277 
278  // mf 6/15/01 fix of Bug 005
279  threshold = orig.threshold;
280  traceThreshold = orig.traceThreshold;
281  limits = orig.limits;
282  preamble = orig.preamble;
283  newline = orig.newline;
284  indent = orig.indent;
285  lineLength = orig.lineLength;
286 
287  ignoreMostModules = orig.ignoreMostModules;
288  respondToThese = orig.respondToThese;
289  respondToMostModules = orig.respondToMostModules;
290  ignoreThese = orig.ignoreThese;
291 
292 } // ELoutput()
ELseverityLevel traceThreshold
edm::ELextendedID xid
Definition: ELoutput.h:115
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
edm::service::ELoutput::~ELoutput ( )
virtual

Definition at line 295 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr.

295  {
296 
297  #ifdef ELoutputCONSTRUCTOR_TRACE
298  std::cerr << "Destructor for ELoutput\n";
299  #endif
300 
301 } // ~ELoutput()

Member Function Documentation

void edm::service::ELoutput::attachEpilogue ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 653 of file ELoutput.cc.

References wantEpilogueSeparate.

653 { wantEpilogueSeparate = false; }
void edm::service::ELoutput::attachTime ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 650 of file ELoutput.cc.

References wantTimeSeparate.

650 { wantTimeSeparate = false; }
void edm::service::ELoutput::changeFile ( std::ostream &  os)
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 694 of file ELoutput.cc.

References emitToken(), edm::service::formatTime(), os, and cond::rpcobgas::time.

694  {
695  os.reset(&os_, do_nothing_deleter());
696  emitToken( "\n=======================================================", true );
697  emitToken( "\nError Log changed to this stream\n" );
698  ELstring const& ftime = formatTime(time(0)); // Change log 7
699  emitToken( ftime, true );
700  emitToken( "\n=======================================================\n", true );
701 }
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:101
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:544
std::string ELstring
Definition: ELstring.h:26
void edm::service::ELoutput::changeFile ( const ELstring filename)
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 703 of file ELoutput.cc.

References emitToken(), edm::service::formatTime(), os, and cond::rpcobgas::time.

703  {
704  os.reset(new std::ofstream( filename.c_str(), std::ios/*_base*/::app), close_and_delete());
705  emitToken( "\n=======================================================", true );
706  emitToken( "\nError Log changed to this file\n" );
707  ELstring const& ftime = formatTime(time(0)); // Change log 7
708  emitToken( ftime, true );
709  emitToken( "\n=======================================================\n", true );
710 }
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:101
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:544
tuple filename
Definition: lut2db_cfg.py:20
std::string ELstring
Definition: ELstring.h:26
ELoutput * edm::service::ELoutput::clone ( void  ) const
virtual

Implements edm::service::ELdestination.

Reimplemented in edm::service::ELcollected.

Definition at line 309 of file ELoutput.cc.

References ELoutput().

309  {
310 
311  return new ELoutput( *this );
312 
313 } // clone()
void edm::service::ELoutput::emitToken ( const ELstring s,
bool  nl = false 
)
protectedvirtual

Reimplemented in edm::service::ELcollected.

Definition at line 544 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr, charsOnLine, edm::first(), edm::service::ELdestination::indent, prof2calltree::last, edm::service::ELdestination::lineLength, edm::service::ELdestination::newline, preambleMode, alignCSCRings::s, and edm::second().

Referenced by changeFile(), ELoutput(), log(), and summarization().

544  {
545 
546  #ifdef ELoutput_EMIT_TRACE
547  std::cerr << "[][][] in emit: charsOnLine is " << charsOnLine << '\n';
548  std::cerr << "[][][] in emit: s.length() " << s.length() << '\n';
549  std::cerr << "[][][] in emit: lineLength is " << lineLength << '\n';
550  #endif
551 
552  if (s.length() == 0) {
553  if ( nl ) {
554  (*os) << newline << std::flush;
555  charsOnLine = 0;
556  }
557  return;
558  }
559 
560  char first = s[0];
561  char second,
562  last,
563  last2;
564  second = (s.length() < 2) ? '\0' : s[1];
565  last = (s.length() < 2) ? '\0' : s[s.length()-1];
566  last2 = (s.length() < 3) ? '\0' : s[s.length()-2];
567  //checking -2 because the very last char is sometimes a ' ' inserted
568  //by ErrorLog::operator<<
569 
570  if (preambleMode) {
571  //Accounts for newline @ the beginning of the ELstring JV:2
572  if ( first == '\n'
573  || (charsOnLine + static_cast<int>(s.length())) > lineLength ) {
574  #ifdef ELoutput_EMIT_TRACE
575  std::cerr << "[][][] in emit: about to << to *os \n";
576  #endif
577  #ifdef HEADERS_BROKEN_INTO_LINES_AND_INDENTED
578  // Change log 3: Removed this code 6/11/07 mf
579  (*os) << newline << indent;
580  charsOnLine = indent.length();
581  #else
582  charsOnLine = 0; // Change log 5
583  #endif
584  if (second != ' ') {
585  (*os) << ' ';
586  charsOnLine++;
587  }
588  if ( first == '\n' ) {
589  (*os) << s.substr(1);
590  }
591  else {
592  (*os) << s;
593  }
594  }
595  #ifdef ELoutput_EMIT_TRACE
596  std::cerr << "[][][] in emit: about to << s to *os: " << s << " \n";
597  #endif
598  else {
599  (*os) << s;
600  }
601 
602  if (last == '\n' || last2 == '\n') { //accounts for newline @ end $$ JV:2
603  (*os) << indent; //of the ELstring
604  if (last != ' ')
605  (*os) << ' ';
606  charsOnLine = indent.length() + 1;
607  }
608 
609  if ( nl ) { (*os) << newline << std::flush; charsOnLine = 0; }
610  else { charsOnLine += s.length(); }
611 }
612 
613  if (!preambleMode) {
614  (*os) << s;
615  }
616 
617  #ifdef ELoutput_EMIT_TRACE
618  std::cerr << "[][][] in emit: completed \n";
619  #endif
620 
621 } // emitToken()
U second(std::pair< T, U > const &p)
T first(std::pair< T, U > const &p)
void edm::service::ELoutput::flush ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 712 of file ELoutput.cc.

References os.

Referenced by log().

712  {
713  os->flush();
714 }
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
void edm::service::ELoutput::includeContext ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 640 of file ELoutput.cc.

References wantSomeContext.

640 { wantSomeContext = true; }
void edm::service::ELoutput::includeModule ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 631 of file ELoutput.cc.

References wantModule.

631 { wantModule = true; }
void edm::service::ELoutput::includeSerial ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 644 of file ELoutput.cc.

References wantSerial.

644 { wantSerial = true; }
void edm::service::ELoutput::includeSubroutine ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 634 of file ELoutput.cc.

References wantSubroutine.

634 { wantSubroutine = true; }
void edm::service::ELoutput::includeText ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 637 of file ELoutput.cc.

References wantText.

637 { wantText = true; }
void edm::service::ELoutput::includeTime ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 628 of file ELoutput.cc.

References wantTimestamp.

628 { wantTimestamp = true; }
bool edm::service::ELoutput::log ( const edm::ErrorObj msg)
virtual

Reimplemented from edm::service::ELdestination.

Reimplemented in edm::service::ELcollected.

Definition at line 318 of file ELoutput.cc.

References edm::service::ELlimitsTable::add(), dtNoiseDBValidation_cfg::cerr, charsOnLine, edm::service::ELcontextSupplier::context(), edm::ELsevere, edm::ELsuccess, emitToken(), flush(), edm::service::formatTime(), edm::service::ELadministrator::getContextSupplier(), edm::ELseverityLevel::getSymbol(), edm::ELextendedID::id, edm::ErrorObj::idOverflow(), edm::service::ELadministrator::instance(), edm::ErrorObj::is_verbatim(), edm::ErrorObj::items(), edm::service::ELdestination::limits, edm::ELextendedID::module, edm::service::ELdestination::newline, edm::service::ELdestination::preamble, preambleMode, alignCSCRings::s, edm::ErrorObj::serial(), edm::ELextendedID::severity, edm::ELextendedID::subroutine, edm::service::ELdestination::thisShouldBeIgnored(), edm::service::ELdestination::threshold, edm::ErrorObj::timestamp(), edm::service::ELdestination::traceThreshold, wantEpilogueSeparate, wantFullContext, wantModule, wantSerial, wantSomeContext, wantSubroutine, wantText, wantTimeSeparate, wantTimestamp, edm::ErrorObj::xid(), and xid.

318  {
319 
320  #ifdef ELoutputTRACE_LOG
321  std::cerr << " =:=:=: Log to an ELoutput \n";
322  #endif
323 
324  xid = msg.xid(); // Save the xid.
325 
326 #ifdef THRESHTRACE
327  std::cerr << " =:=:=: Log to an ELoutput \n"
328  << " severity = " << xid.severity << "\n"
329  << " threshold = " << threshold << "\n"
330  << " id = " << xid.id << "\n";
331 #endif
332 
333  // See if this message is to be acted upon, and add it to limits table
334  // if it was not already present:
335  //
336  if ( xid.severity < threshold ) return false;
338  && (xid.severity < ELsevere) /* change log 2 */ )
339  return false;
340  if ( ! limits.add( xid )
341  && (xid.severity < ELsevere) /* change log 2 */ )
342  return false;
343 
344  #ifdef ELoutputTRACE_LOG
345  std::cerr << " =:=:=: Limits table work done \n";
346  #endif
347 
348  // Output the prologue:
349  //
350  preambleMode = true;
351 
352  if ( !msg.is_verbatim() ) {
353  charsOnLine = 0; // Change log 5
354  emitToken( preamble );
356  emitToken( " " );
357  emitToken( xid.id );
358  emitToken( msg.idOverflow() );
359  emitToken( ": " );
360  }
361 
362  #ifdef ELoutputTRACE_LOG
363  std::cerr << " =:=:=: Prologue done \n";
364  #endif
365  // Output serial number of message:
366  //
367  if ( !msg.is_verbatim() )
368  {
369  if ( wantSerial ) {
370  std::ostringstream s;
371  s << msg.serial();
372  emitToken( "[serial #" + s.str() + ELstring("] ") );
373  }
374  }
375 
376 #ifdef OUTPUT_FORMATTED_ERROR_MESSAGES
377  // Output each item in the message (before the epilogue):
378  //
379  if ( wantText ) {
380  ELlist_string::const_iterator it;
381  for ( it = msg.items().begin(); it != msg.items().end(); ++it ) {
382  #ifdef ELoutputTRACE_LOG
383  std::cerr << " =:=:=: Item: " << *it << '\n';
384  #endif
385  emitToken( *it );
386  }
387  }
388 #endif
389 
390  // Provide further identification:
391  //
392  bool needAspace = true;
393  if ( !msg.is_verbatim() )
394  {
395  if ( wantEpilogueSeparate ) {
396  if ( xid.module.length() + xid.subroutine.length() > 0 ) {
397  emitToken("\n");
398  needAspace = false;
399  }
400  else if ( wantTimestamp && !wantTimeSeparate ) {
401  emitToken("\n");
402  needAspace = false;
403  }
404  }
405  if ( wantModule && (xid.module.length() > 0) ) {
406  if (needAspace) { emitToken(ELstring(" ")); needAspace = false; }
407  emitToken( xid.module + ELstring(" ") );
408  }
409  if ( wantSubroutine && (xid.subroutine.length() > 0) ) {
410  if (needAspace) { emitToken(ELstring(" ")); needAspace = false; }
411  emitToken( xid.subroutine + "()" + ELstring(" ") );
412  }
413  }
414 
415  #ifdef ELoutputTRACE_LOG
416  std::cerr << " =:=:=: Module and Subroutine done \n";
417  #endif
418 
419  // Provide time stamp:
420  //
421  if ( !msg.is_verbatim() )
422  {
423  if ( wantTimestamp ) {
424  if ( wantTimeSeparate ) {
425  emitToken( ELstring("\n") );
426  needAspace = false;
427  }
428  if (needAspace) { emitToken(ELstring(" ")); needAspace = false; }
429  ELstring const& ftime = formatTime(msg.timestamp()); // Change log 7
430  emitToken( ftime + ELstring(" ") );
431  }
432  }
433 
434  #ifdef ELoutputTRACE_LOG
435  std::cerr << " =:=:=: TimeStamp done \n";
436  #endif
437 
438  // Provide the context information:
439  //
440  if ( !msg.is_verbatim() )
441  {
442  if ( wantSomeContext ) {
443  if (needAspace) { emitToken(ELstring(" ")); needAspace = false; }
444  #ifdef ELoutputTRACE_LOG
445  std::cerr << " =:=:=:>> context supplier is at 0x"
446  << std::hex
448  std::cerr << " =:=:=:>> context is --- "
450  << '\n';
451  #endif
452  if ( wantFullContext ) {
453  emitToken( ELadministrator::instance()->getContextSupplier().fullContext());
454  #ifdef ELoutputTRACE_LOG
455  std::cerr << " =:=:=: fullContext done: \n";
456  #endif
457  } else {
458  emitToken( ELadministrator::instance()->getContextSupplier().context());
459  #ifdef ELoutputTRACE_LOG
460  std::cerr << " =:=:=: Context done: \n";
461  #endif
462  }
463  }
464  }
465 
466  // Provide traceback information:
467  //
468 
469  bool insertNewlineAfterHeader = ( msg.xid().severity != ELsuccess );
470  // ELsuccess is what LogDebug issues
471 
472  if ( !msg.is_verbatim() )
473  {
474  if ( msg.xid().severity >= traceThreshold ) {
475  emitToken( ELstring("\n")
476  + ELadministrator::instance()->getContextSupplier().traceRoutine()
477  , insertNewlineAfterHeader );
478  }
479  else { //else statement added JV:1
480  emitToken("", insertNewlineAfterHeader);
481  }
482  }
483  #ifdef ELoutputTRACE_LOG
484  std::cerr << " =:=:=: Trace routine done: \n";
485  #endif
486 
487 #ifndef OUTPUT_FORMATTED_ERROR_MESSAGES
488  // Finally, output each item in the message:
489  //
490  preambleMode = false;
491  if ( wantText ) {
492  ELlist_string::const_iterator it;
493  int item_count = 0;
494  for ( it = msg.items().begin(); it != msg.items().end(); ++it ) {
495  #ifdef ELoutputTRACE_LOG
496  std::cerr << " =:=:=: Item: " << *it << '\n';
497  #endif
498  ++item_count;
499  if ( !msg.is_verbatim() ) {
500  if ( !insertNewlineAfterHeader && (item_count == 3) ) {
501  // in a LogDebug message, the first 3 items are FILE, :, and LINE
502  emitToken( *it, true );
503  } else {
504  emitToken( *it );
505  }
506  } else {
507  emitToken( *it );
508  }
509  }
510  }
511 #endif
512 
513  // And after the message, add a %MSG on its own line
514  // Change log 4 6/11/07 mf
515 
516  if ( !msg.is_verbatim() )
517  {
518  emitToken("\n%MSG");
519  }
520 
521 
522  // Done; message has been fully processed; separate, flush, and leave
523  //
524 
525  (*os) << newline;
526  flush();
527 
528 
529  #ifdef ELoutputTRACE_LOG
530  std::cerr << " =:=:=: log(msg) done: \n";
531  #endif
532 
533  return true;
534 
535 } // log()
ELseverityLevel traceThreshold
const ELcontextSupplier & getContextSupplier() const
ELseverityLevel severity
Definition: ELextendedID.h:36
const ELstring & idOverflow() const
Definition: ErrorObj.cc:147
ELslProxy< ELsuccessGen > const ELsuccess
time_t timestamp() const
Definition: ErrorObj.cc:148
virtual bool thisShouldBeIgnored(const ELstring &s) const
edm::ELextendedID xid
Definition: ELoutput.h:115
const ELstring getSymbol() const
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:101
const ELextendedID & xid() const
Definition: ErrorObj.cc:146
bool add(const ELextendedID &xid)
int serial() const
Definition: ErrorObj.cc:145
virtual ELstring context() const =0
ELstring subroutine
Definition: ELextendedID.h:38
const ELlist_string & items() const
Definition: ErrorObj.cc:149
ELslProxy< ELsevereGen > const ELsevere
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:544
static ELadministrator * instance()
virtual void flush()
Definition: ELoutput.cc:712
bool is_verbatim() const
Definition: ErrorObj.cc:151
std::string ELstring
Definition: ELstring.h:26
ELoutput& edm::service::ELoutput::operator= ( const ELoutput orig)
protected
void edm::service::ELoutput::separateEpilogue ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 652 of file ELoutput.cc.

References wantEpilogueSeparate.

652 { wantEpilogueSeparate = true; }
void edm::service::ELoutput::separateTime ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 649 of file ELoutput.cc.

References wantTimeSeparate.

649 { wantTimeSeparate = true; }
void edm::service::ELoutput::summarization ( const ELstring fullTitle,
const ELstring sumLines 
)
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 660 of file ELoutput.cc.

References emitToken(), geometryCSVtoXML::line, edm::service::ELdestination::lineLength, os, lumiQueryAPI::q, and indexGen::title.

663  {
664  const int titleMaxLength( 40 );
665 
666  // title:
667  //
668  ELstring title( fullTitle, 0, titleMaxLength );
669  int q = (lineLength - title.length() - 2) / 2;
670  ELstring line(q, '=');
671  emitToken( "", true );
672  emitToken( line );
673  emitToken( " " );
674  emitToken( title );
675  emitToken( " " );
676  emitToken( line, true );
677 
678  // body:
679  //
680  *os << sumLines;
681 
682  // finish:
683  //
684  emitToken( "", true );
685  emitToken( ELstring(lineLength, '='), true );
686 
687 } // summarization()
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:544
std::string ELstring
Definition: ELstring.h:26
void edm::service::ELoutput::suppressContext ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 641 of file ELoutput.cc.

References wantSomeContext.

641 { wantSomeContext = false; }
void edm::service::ELoutput::suppressModule ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 632 of file ELoutput.cc.

References wantModule.

632 { wantModule = false; }
void edm::service::ELoutput::suppressSerial ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 643 of file ELoutput.cc.

References wantSerial.

643 { wantSerial = false; }
void edm::service::ELoutput::suppressSubroutine ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 635 of file ELoutput.cc.

References wantSubroutine.

635 { wantSubroutine = false; }
void edm::service::ELoutput::suppressText ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 638 of file ELoutput.cc.

References wantText.

638 { wantText = false; }
void edm::service::ELoutput::suppressTime ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 629 of file ELoutput.cc.

References wantTimestamp.

629 { wantTimestamp = false; }
void edm::service::ELoutput::useContext ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 647 of file ELoutput.cc.

References wantFullContext.

647 { wantFullContext = false; }
void edm::service::ELoutput::useFullContext ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 646 of file ELoutput.cc.

References wantFullContext.

646 { wantFullContext = true; }

Friends And Related Function Documentation

friend class ELdestControl
friend

Definition at line 51 of file ELoutput.h.

Member Data Documentation

int edm::service::ELoutput::charsOnLine
protected

Definition at line 114 of file ELoutput.h.

Referenced by emitToken(), edm::service::ELcollected::emitToken(), and log().

boost::shared_ptr<std::ostream> edm::service::ELoutput::os
protected

Definition at line 113 of file ELoutput.h.

Referenced by changeFile(), ELoutput(), flush(), and summarization().

bool edm::service::ELoutput::preambleMode
protected

Definition at line 118 of file ELoutput.h.

Referenced by ELoutput(), emitToken(), and log().

bool edm::service::ELoutput::wantEpilogueSeparate
protected

Definition at line 118 of file ELoutput.h.

Referenced by attachEpilogue(), log(), and separateEpilogue().

bool edm::service::ELoutput::wantFullContext
protected

Definition at line 118 of file ELoutput.h.

Referenced by log(), useContext(), and useFullContext().

bool edm::service::ELoutput::wantModule
protected

Definition at line 118 of file ELoutput.h.

Referenced by includeModule(), log(), and suppressModule().

bool edm::service::ELoutput::wantSerial
protected

Definition at line 118 of file ELoutput.h.

Referenced by includeSerial(), log(), and suppressSerial().

bool edm::service::ELoutput::wantSomeContext
protected

Definition at line 118 of file ELoutput.h.

Referenced by includeContext(), log(), and suppressContext().

bool edm::service::ELoutput::wantSubroutine
protected

Definition at line 118 of file ELoutput.h.

Referenced by includeSubroutine(), log(), and suppressSubroutine().

bool edm::service::ELoutput::wantText
protected

Definition at line 118 of file ELoutput.h.

Referenced by includeText(), log(), edm::service::ELcollected::log(), and suppressText().

bool edm::service::ELoutput::wantTimeSeparate
protected

Definition at line 118 of file ELoutput.h.

Referenced by attachTime(), log(), and separateTime().

bool edm::service::ELoutput::wantTimestamp
protected

Definition at line 118 of file ELoutput.h.

Referenced by includeTime(), log(), and suppressTime().

edm::ELextendedID edm::service::ELoutput::xid
protected

Definition at line 115 of file ELoutput.h.

Referenced by log(), and edm::service::ELcollected::log().