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)
 
bool log (const edm::ErrorObj &msg) override
 
 ~ELoutput () override
 
- 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

void attachEpilogue () override
 
void attachTime () override
 
void changeFile (std::ostream &os) override
 
void changeFile (const ELstring &filename) override
 
void emitToken (const ELstring &s, bool nl=false)
 
void flush () override
 
void includeContext () override
 
void includeModule () override
 
void includeSerial () override
 
void includeSubroutine () override
 
void includeText () override
 
void includeTime () override
 
ELoutputoperator= (const ELoutput &orig)=delete
 
void separateEpilogue () override
 
void separateTime () override
 
void suppressContext () override
 
void suppressModule () override
 
void suppressSerial () override
 
void suppressSubroutine () override
 
void suppressText () override
 
void suppressTime () override
 
void useContext () override
 
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 44 of file ELoutput.h.

Constructor & Destructor Documentation

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

Definition at line 125 of file ELoutput.cc.

References MessageLogger_cfi::cerr, and emitToken().

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

Definition at line 151 of file ELoutput.cc.

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

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

Definition at line 181 of file ELoutput.cc.

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

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

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

246  : ELdestination(),
247  os(orig.os),
248  charsOnLine(orig.charsOnLine),
249  xid(orig.xid),
250  wantTimestamp(orig.wantTimestamp),
251  wantModule(orig.wantModule),
252  wantSubroutine(orig.wantSubroutine),
253  wantText(orig.wantText),
254  wantSomeContext(orig.wantSomeContext),
255  wantSerial(orig.wantSerial),
256  wantFullContext(orig.wantFullContext),
257  wantTimeSeparate(orig.wantTimeSeparate),
258  wantEpilogueSeparate(orig.wantEpilogueSeparate),
259  preambleMode(orig.preambleMode) // 006 9/2/10 mf
260  {
261 #ifdef ELoutputCONSTRUCTOR_TRACE
262  std::cerr << "Copy constructor for ELoutput\n";
263 #endif
264 
265  // mf 6/15/01 fix of Bug 005
266  threshold = orig.threshold;
267  traceThreshold = orig.traceThreshold;
268  limits = orig.limits;
269  preamble = orig.preamble;
270  newline = orig.newline;
271  indent = orig.indent;
272  lineLength = orig.lineLength;
273 
274  ignoreMostModules = orig.ignoreMostModules;
275  respondToThese = orig.respondToThese;
276  respondToMostModules = orig.respondToMostModules;
277  ignoreThese = orig.ignoreThese;
278 
279  } // ELoutput()
ELseverityLevel traceThreshold
std::unordered_set< std::string > ignoreThese
edm::ELextendedID xid
Definition: ELoutput.h:97
std::unordered_set< std::string > respondToThese
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:95
edm::service::ELoutput::~ELoutput ( )
override

Definition at line 281 of file ELoutput.cc.

References MessageLogger_cfi::cerr.

281  {
282 #ifdef ELoutputCONSTRUCTOR_TRACE
283  std::cerr << "Destructor for ELoutput\n";
284 #endif
285 
286  } // ~ELoutput()

Member Function Documentation

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

Reimplemented from edm::service::ELdestination.

Definition at line 618 of file ELoutput.cc.

References wantEpilogueSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 615 of file ELoutput.cc.

References wantTimeSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 624 of file ELoutput.cc.

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

624  {
625  os.reset(&os_, do_nothing_deleter());
626  emitToken("\n=======================================================", true);
627  emitToken("\nError Log changed to this stream\n");
628  ELstring const& ftime = formatTime(time(nullptr)); // Change log 7
629  emitToken(ftime, true);
630  emitToken("\n=======================================================\n", true);
631  }
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:98
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:95
void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:511
std::string ELstring
Definition: ELstring.h:21
void edm::service::ELoutput::changeFile ( const ELstring filename)
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 633 of file ELoutput.cc.

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

633  {
634  os.reset(new std::ofstream(filename.c_str(), std::ios /*_base*/ ::app), close_and_delete());
635  emitToken("\n=======================================================", true);
636  emitToken("\nError Log changed to this file\n");
637  ELstring const& ftime = formatTime(time(nullptr)); // Change log 7
638  emitToken(ftime, true);
639  emitToken("\n=======================================================\n", true);
640  }
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:98
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:95
void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:511
std::string ELstring
Definition: ELstring.h:21
void edm::service::ELoutput::emitToken ( const ELstring s,
bool  nl = false 
)
protected

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

511  {
512 #ifdef ELoutput_EMIT_TRACE
513  std::cerr << "[][][] in emit: charsOnLine is " << charsOnLine << '\n';
514  std::cerr << "[][][] in emit: s.length() " << s.length() << '\n';
515  std::cerr << "[][][] in emit: lineLength is " << lineLength << '\n';
516 #endif
517 
518  if (s.length() == 0) {
519  if (nl) {
520  (*os) << newline << std::flush;
521  charsOnLine = 0;
522  }
523  return;
524  }
525 
526  char first = s[0];
527  char second, last, last2;
528  second = (s.length() < 2) ? '\0' : s[1];
529  last = (s.length() < 2) ? '\0' : s[s.length() - 1];
530  last2 = (s.length() < 3) ? '\0' : s[s.length() - 2];
531  //checking -2 because the very last char is sometimes a ' ' inserted
532  //by ErrorLog::operator<<
533 
534  if (preambleMode) {
535  //Accounts for newline @ the beginning of the ELstring JV:2
536  if (first == '\n' || (charsOnLine + static_cast<int>(s.length())) > lineLength) {
537 #ifdef ELoutput_EMIT_TRACE
538  std::cerr << "[][][] in emit: about to << to *os \n";
539 #endif
540 #ifdef HEADERS_BROKEN_INTO_LINES_AND_INDENTED
541  // Change log 3: Removed this code 6/11/07 mf
542  (*os) << newline << indent;
543  charsOnLine = indent.length();
544 #else
545  charsOnLine = 0; // Change log 5
546 #endif
547  if (second != ' ') {
548  (*os) << ' ';
549  charsOnLine++;
550  }
551  if (first == '\n') {
552  (*os) << s.substr(1);
553  } else {
554  (*os) << s;
555  }
556  }
557 #ifdef ELoutput_EMIT_TRACE
558  std::cerr << "[][][] in emit: about to << s to *os: " << s << " \n";
559 #endif
560  else {
561  (*os) << s;
562  }
563 
564  if (last == '\n' || last2 == '\n') { //accounts for newline @ end $$ JV:2
565  (*os) << indent; //of the ELstring
566  if (last != ' ')
567  (*os) << ' ';
568  charsOnLine = indent.length() + 1;
569  }
570 
571  if (nl) {
572  (*os) << newline << std::flush;
573  charsOnLine = 0;
574  } else {
575  charsOnLine += s.length();
576  }
577  }
578 
579  if (!preambleMode) {
580  (*os) << s;
581  }
582 
583 #ifdef ELoutput_EMIT_TRACE
584  std::cerr << "[][][] in emit: completed \n";
585 #endif
586 
587  } // 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 642 of file ELoutput.cc.

References os.

Referenced by log().

642 { os->flush(); }
std::shared_ptr< std::ostream > os
Definition: ELoutput.h:95
void edm::service::ELoutput::includeContext ( )
overrideprotectedvirtual

Reimplemented from edm::service::ELdestination.

Definition at line 605 of file ELoutput.cc.

References wantSomeContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 596 of file ELoutput.cc.

References wantModule.

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

Reimplemented from edm::service::ELdestination.

Definition at line 609 of file ELoutput.cc.

References wantSerial.

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

Reimplemented from edm::service::ELdestination.

Definition at line 599 of file ELoutput.cc.

References wantSubroutine.

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

Reimplemented from edm::service::ELdestination.

Definition at line 602 of file ELoutput.cc.

References wantText.

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

Reimplemented from edm::service::ELdestination.

Definition at line 593 of file ELoutput.cc.

References wantTimestamp.

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

Reimplemented from edm::service::ELdestination.

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

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

Reimplemented from edm::service::ELdestination.

Definition at line 617 of file ELoutput.cc.

References wantEpilogueSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 614 of file ELoutput.cc.

References wantTimeSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 606 of file ELoutput.cc.

References wantSomeContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 597 of file ELoutput.cc.

References wantModule.

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

Reimplemented from edm::service::ELdestination.

Definition at line 608 of file ELoutput.cc.

References wantSerial.

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

Reimplemented from edm::service::ELdestination.

Definition at line 600 of file ELoutput.cc.

References wantSubroutine.

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

Reimplemented from edm::service::ELdestination.

Definition at line 603 of file ELoutput.cc.

References wantText.

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

Reimplemented from edm::service::ELdestination.

Definition at line 594 of file ELoutput.cc.

References wantTimestamp.

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

Reimplemented from edm::service::ELdestination.

Definition at line 612 of file ELoutput.cc.

References wantFullContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 611 of file ELoutput.cc.

References wantFullContext.

611 { wantFullContext = true; }

Member Data Documentation

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

Definition at line 96 of file ELoutput.h.

Referenced by emitToken(), and log().

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

Definition at line 95 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 99 of file ELoutput.h.

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

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

Definition at line 97 of file ELoutput.h.

Referenced by log().