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

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
 
std::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 126 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr, and emitToken().

Referenced by clone().

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

Definition at line 154 of file ELoutput.cc.

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

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

Definition at line 186 of file ELoutput.cc.

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

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

Definition at line 256 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.

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

Definition at line 294 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr.

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

Member Function Documentation

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

Reimplemented from edm::service::ELdestination.

Definition at line 644 of file ELoutput.cc.

References wantEpilogueSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 641 of file ELoutput.cc.

References wantTimeSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 685 of file ELoutput.cc.

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

685  {
686  os.reset(&os_, do_nothing_deleter());
687  emitToken( "\n=======================================================", true );
688  emitToken( "\nError Log changed to this stream\n" );
689  ELstring const& ftime = formatTime(time(0)); // Change log 7
690  emitToken( ftime, true );
691  emitToken( "\n=======================================================\n", true );
692 }
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:100
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:535
std::string ELstring
Definition: ELstring.h:26
void edm::service::ELoutput::changeFile ( const ELstring filename)
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(new std::ofstream( filename.c_str(), std::ios/*_base*/::app), close_and_delete());
696  emitToken( "\n=======================================================", true );
697  emitToken( "\nError Log changed to this file\n" );
698  ELstring const& ftime = formatTime(time(0)); // Change log 7
699  emitToken( ftime, true );
700  emitToken( "\n=======================================================\n", true );
701 }
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:100
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:535
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.

Definition at line 308 of file ELoutput.cc.

References ELoutput().

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

Definition at line 535 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().

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

References os.

Referenced by log().

703  {
704  os->flush();
705 }
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
void edm::service::ELoutput::includeContext ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 631 of file ELoutput.cc.

References wantSomeContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 622 of file ELoutput.cc.

References wantModule.

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

Reimplemented from edm::service::ELdestination.

Definition at line 635 of file ELoutput.cc.

References wantSerial.

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

Reimplemented from edm::service::ELdestination.

Definition at line 625 of file ELoutput.cc.

References wantSubroutine.

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

Reimplemented from edm::service::ELdestination.

Definition at line 628 of file ELoutput.cc.

References wantText.

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

Reimplemented from edm::service::ELdestination.

Definition at line 619 of file ELoutput.cc.

References wantTimestamp.

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

Reimplemented from edm::service::ELdestination.

Definition at line 317 of file ELoutput.cc.

References edm::service::ELlimitsTable::add(), assert(), dtNoiseDBValidation_cfg::cerr, charsOnLine, edm::ErrorObj::context(), edm::ELdebug, edm::ELsevere, emitToken(), flush(), edm::service::formatTime(), edm::ELseverityLevel::getSymbol(), edm::ELextendedID::id, edm::ErrorObj::idOverflow(), 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.

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

Reimplemented from edm::service::ELdestination.

Definition at line 643 of file ELoutput.cc.

References wantEpilogueSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 640 of file ELoutput.cc.

References wantTimeSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 651 of file ELoutput.cc.

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

654  {
655  const int titleMaxLength( 40 );
656 
657  // title:
658  //
659  ELstring title( fullTitle, 0, titleMaxLength );
660  int q = (lineLength - title.length() - 2) / 2;
661  ELstring line(q, '=');
662  emitToken( "", true );
663  emitToken( line );
664  emitToken( " " );
665  emitToken( title );
666  emitToken( " " );
667  emitToken( line, true );
668 
669  // body:
670  //
671  *os << sumLines;
672 
673  // finish:
674  //
675  emitToken( "", true );
676  emitToken( ELstring(lineLength, '='), true );
677 
678 } // summarization()
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:535
std::string ELstring
Definition: ELstring.h:26
void edm::service::ELoutput::suppressContext ( )
protectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 632 of file ELoutput.cc.

References wantSomeContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 623 of file ELoutput.cc.

References wantModule.

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

Reimplemented from edm::service::ELdestination.

Definition at line 634 of file ELoutput.cc.

References wantSerial.

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

Reimplemented from edm::service::ELdestination.

Definition at line 626 of file ELoutput.cc.

References wantSubroutine.

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

Reimplemented from edm::service::ELdestination.

Definition at line 629 of file ELoutput.cc.

References wantText.

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

Reimplemented from edm::service::ELdestination.

Definition at line 620 of file ELoutput.cc.

References wantTimestamp.

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

Reimplemented from edm::service::ELdestination.

Definition at line 638 of file ELoutput.cc.

References wantFullContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 637 of file ELoutput.cc.

References wantFullContext.

637 { 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(), and log().

std::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(), 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().