CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
edm::service::ELoutput Class Reference

#include <ELoutput.h>

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

Public Member Functions

 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) override
 
virtual ~ELoutput ()
 
- Public Member Functions inherited from edm::service::ELdestination
 ELdestination ()
 
virtual void excludeModule (ELstring const &moduleName)
 
virtual void filterModule (ELstring const &moduleName)
 
virtual void finish ()
 
virtual int getLineLength () const
 
virtual ELstring getNewline () const
 
virtual void ignoreModule (ELstring const &moduleName)
 
virtual void respondToModule (ELstring const &moduleName)
 
void setInterval (const ELstring &s, int interval)
 
void setInterval (const ELseverityLevel &sv, int interval)
 
void setLimit (const ELstring &s, int n)
 
void setLimit (const ELseverityLevel &sv, int n)
 
virtual int setLineLength (int len)
 
virtual void setTableLimit (int n)
 
void setThreshold (const ELseverityLevel &sv)
 
void setTimespan (const ELstring &s, int n)
 
void setTimespan (const ELseverityLevel &sv, int n)
 
void setTraceThreshold (const ELseverityLevel &sv)
 
virtual bool thisShouldBeIgnored (const ELstring &s) const
 
virtual void wipe ()
 
virtual void zero ()
 
virtual ~ELdestination ()
 

Protected Member Functions

virtual void attachEpilogue () override
 
virtual void attachTime () override
 
virtual void changeFile (std::ostream &os) override
 
virtual void changeFile (const ELstring &filename) override
 
void emitToken (const ELstring &s, bool nl=false)
 
virtual void flush () override
 
virtual void includeContext () override
 
virtual void includeModule () override
 
virtual void includeSerial () override
 
virtual void includeSubroutine () override
 
virtual void includeText () override
 
virtual void includeTime () override
 
ELoutputoperator= (const ELoutput &orig)=delete
 
virtual void separateEpilogue () override
 
virtual void separateTime () override
 
virtual void suppressContext () override
 
virtual void suppressModule () override
 
virtual void suppressSerial () override
 
virtual void suppressSubroutine () override
 
virtual void suppressText () override
 
virtual void suppressTime () override
 
virtual void useContext () override
 
virtual void useFullContext () override
 

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
 
std::unordered_set< std::string > ignoreThese
 
ELstring indent
 
ELlimitsTable limits
 
int lineLength
 
ELstring newline
 
ELstring preamble
 
bool respondToMostModules
 
std::unordered_set< std::string > respondToThese
 
ELseverityLevel threshold
 
ELseverityLevel traceThreshold
 

Additional Inherited Members

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

Detailed Description

Definition at line 47 of file ELoutput.h.

Constructor & Destructor Documentation

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

Definition at line 126 of file ELoutput.cc.

References MessageLogger_cfi::cerr, and emitToken().

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:103
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:101
void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:528
edm::service::ELoutput::ELoutput ( std::ostream &  os,
bool  emitAtStart = false 
)

Definition at line 154 of file ELoutput.cc.

References MessageLogger_cfi::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:103
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:101
void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:528
edm::service::ELoutput::ELoutput ( const ELstring fileName,
bool  emitAtStart = false 
)

Definition at line 186 of file ELoutput.cc.

References MessageLogger_cfi::cerr, emitToken(), edm::service::formatTime(), os, preambleMode, and ntuplemaker::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:103
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:100
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:101
void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:528
std::string ELstring
Definition: ELstring.h:26
edm::service::ELoutput::ELoutput ( const ELoutput orig)

Definition at line 256 of file ELoutput.cc.

References MessageLogger_cfi::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
std::unordered_set< std::string > ignoreThese
edm::ELextendedID xid
Definition: ELoutput.h:103
std::unordered_set< std::string > respondToThese
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:101
edm::service::ELoutput::~ELoutput ( )
virtual

Definition at line 294 of file ELoutput.cc.

References MessageLogger_cfi::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 ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 637 of file ELoutput.cc.

References wantEpilogueSeparate.

637 { wantEpilogueSeparate = false; }
void edm::service::ELoutput::attachTime ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 634 of file ELoutput.cc.

References wantTimeSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 644 of file ELoutput.cc.

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

644  {
645  os.reset(&os_, do_nothing_deleter());
646  emitToken( "\n=======================================================", true );
647  emitToken( "\nError Log changed to this stream\n" );
648  ELstring const& ftime = formatTime(time(0)); // Change log 7
649  emitToken( ftime, true );
650  emitToken( "\n=======================================================\n", true );
651 }
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:100
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:101
void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:528
std::string ELstring
Definition: ELstring.h:26
void edm::service::ELoutput::changeFile ( const ELstring filename)
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 653 of file ELoutput.cc.

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

653  {
654  os.reset(new std::ofstream( filename.c_str(), std::ios/*_base*/::app), close_and_delete());
655  emitToken( "\n=======================================================", true );
656  emitToken( "\nError Log changed to this file\n" );
657  ELstring const& ftime = formatTime(time(0)); // Change log 7
658  emitToken( ftime, true );
659  emitToken( "\n=======================================================\n", true );
660 }
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:100
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:101
void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:528
std::string ELstring
Definition: ELstring.h:26
void edm::service::ELoutput::emitToken ( const ELstring s,
bool  nl = false 
)
protected

Definition at line 528 of file ELoutput.cc.

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

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

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

Reimplemented from edm::service::ELdestination.

Definition at line 662 of file ELoutput.cc.

References os.

Referenced by log().

662  {
663  os->flush();
664 }
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:101
void edm::service::ELoutput::includeContext ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 624 of file ELoutput.cc.

References wantSomeContext.

624 { wantSomeContext = true; }
void edm::service::ELoutput::includeModule ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 615 of file ELoutput.cc.

References wantModule.

615 { wantModule = true; }
void edm::service::ELoutput::includeSerial ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 628 of file ELoutput.cc.

References wantSerial.

628 { wantSerial = true; }
void edm::service::ELoutput::includeSubroutine ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 618 of file ELoutput.cc.

References wantSubroutine.

618 { wantSubroutine = true; }
void edm::service::ELoutput::includeText ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 621 of file ELoutput.cc.

References wantText.

621 { wantText = true; }
void edm::service::ELoutput::includeTime ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 612 of file ELoutput.cc.

References wantTimestamp.

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

Reimplemented from edm::service::ELdestination.

Definition at line 310 of file ELoutput.cc.

References edm::service::ELlimitsTable::add(), MessageLogger_cfi::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.

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

Reimplemented from edm::service::ELdestination.

Definition at line 636 of file ELoutput.cc.

References wantEpilogueSeparate.

636 { wantEpilogueSeparate = true; }
void edm::service::ELoutput::separateTime ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 633 of file ELoutput.cc.

References wantTimeSeparate.

633 { wantTimeSeparate = true; }
void edm::service::ELoutput::suppressContext ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 625 of file ELoutput.cc.

References wantSomeContext.

625 { wantSomeContext = false; }
void edm::service::ELoutput::suppressModule ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 616 of file ELoutput.cc.

References wantModule.

616 { wantModule = false; }
void edm::service::ELoutput::suppressSerial ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 627 of file ELoutput.cc.

References wantSerial.

627 { wantSerial = false; }
void edm::service::ELoutput::suppressSubroutine ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 619 of file ELoutput.cc.

References wantSubroutine.

619 { wantSubroutine = false; }
void edm::service::ELoutput::suppressText ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 622 of file ELoutput.cc.

References wantText.

622 { wantText = false; }
void edm::service::ELoutput::suppressTime ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 613 of file ELoutput.cc.

References wantTimestamp.

613 { wantTimestamp = false; }
void edm::service::ELoutput::useContext ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 631 of file ELoutput.cc.

References wantFullContext.

631 { wantFullContext = false; }
void edm::service::ELoutput::useFullContext ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 630 of file ELoutput.cc.

References wantFullContext.

630 { wantFullContext = true; }

Member Data Documentation

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

Definition at line 102 of file ELoutput.h.

Referenced by emitToken(), and log().

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

Definition at line 101 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

Referenced by includeText(), log(), and suppressText().

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 106 of file ELoutput.h.

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

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

Definition at line 103 of file ELoutput.h.

Referenced by log().