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 128 of file ELoutput.cc.

References dtNoiseDBValidation_cfg::cerr, and emitToken().

Referenced by clone().

129 : ELdestination ( )
130 , os ( &std::cerr, do_nothing_deleter() )
131 , charsOnLine ( 0 )
132 , xid ( )
133 , wantTimestamp ( true )
134 , wantModule ( true )
135 , wantSubroutine ( true )
136 , wantText ( true )
137 , wantSomeContext ( true )
138 , wantSerial ( false )
139 , wantFullContext ( false )
140 , wantTimeSeparate ( false )
141 , wantEpilogueSeparate( false )
142 , preambleMode ( true ) // 006 9/2/10 mf
143 {
144 
145  #ifdef ELoutputCONSTRUCTOR_TRACE
146  std::cerr << "Constructor for ELoutput()\n";
147  #endif
148 
149  emitToken( "\n=================================================", true );
150  emitToken( "\nMessage Log File written by MessageLogger service \n" );
151  emitToken( "\n=================================================\n", true );
152 
153 } // 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:546
edm::service::ELoutput::ELoutput ( std::ostream &  os,
bool  emitAtStart = false 
)

Definition at line 156 of file ELoutput.cc.

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

157 : ELdestination ( )
158 , os ( &os_, do_nothing_deleter() )
159 , charsOnLine ( 0 )
160 , xid ( )
161 , wantTimestamp ( true )
162 , wantModule ( true )
163 , wantSubroutine ( true )
164 , wantText ( true )
165 , wantSomeContext ( true )
166 , wantSerial ( false )
167 , wantFullContext ( false )
168 , wantTimeSeparate ( false )
169 , wantEpilogueSeparate( false )
170 , preambleMode ( true ) // 006 9/2/10 mf
171 {
172 
173  #ifdef ELoutputCONSTRUCTOR_TRACE
174  std::cerr << "Constructor for ELoutput( os )\n";
175  #endif
176 
177  // Enh 001 2/13/01 mf
178  if (emitAtStart) {
179  preambleMode = true;
180  emitToken( "\n=================================================", true );
181  emitToken( "\nMessage Log File written by MessageLogger service \n" );
182  emitToken( "\n=================================================\n", true );
183  }
184 
185 } // 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:546
edm::service::ELoutput::ELoutput ( const ELstring fileName,
bool  emitAtStart = false 
)

Definition at line 188 of file ELoutput.cc.

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

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

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

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

References dtNoiseDBValidation_cfg::cerr.

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

Member Function Documentation

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

Reimplemented from edm::service::ELdestination.

Definition at line 655 of file ELoutput.cc.

References wantEpilogueSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 652 of file ELoutput.cc.

References wantTimeSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 696 of file ELoutput.cc.

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

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

Reimplemented from edm::service::ELdestination.

Definition at line 705 of file ELoutput.cc.

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

705  {
706  os.reset(new std::ofstream( filename.c_str(), std::ios/*_base*/::app), close_and_delete());
707  emitToken( "\n=======================================================", true );
708  emitToken( "\nError Log changed to this file\n" );
709  ELstring const& ftime = formatTime(time(0)); // Change log 7
710  emitToken( ftime, true );
711  emitToken( "\n=======================================================\n", true );
712 }
boost::shared_ptr< std::ostream > os
Definition: ELoutput.h:113
static ELstring formatTime(const time_t t)
Definition: ELoutput.cc:102
virtual void emitToken(const ELstring &s, bool nl=false)
Definition: ELoutput.cc:546
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 310 of file ELoutput.cc.

References ELoutput().

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

Reimplemented in edm::service::ELcollected.

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

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

References os.

Referenced by log().

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

Reimplemented from edm::service::ELdestination.

Definition at line 642 of file ELoutput.cc.

References wantSomeContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 633 of file ELoutput.cc.

References wantModule.

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

Reimplemented from edm::service::ELdestination.

Definition at line 646 of file ELoutput.cc.

References wantSerial.

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

Reimplemented from edm::service::ELdestination.

Definition at line 636 of file ELoutput.cc.

References wantSubroutine.

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

Reimplemented from edm::service::ELdestination.

Definition at line 639 of file ELoutput.cc.

References wantText.

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

Reimplemented from edm::service::ELdestination.

Definition at line 630 of file ELoutput.cc.

References wantTimestamp.

630 { 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 319 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.

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

References wantEpilogueSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 651 of file ELoutput.cc.

References wantTimeSeparate.

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

Reimplemented from edm::service::ELdestination.

Definition at line 662 of file ELoutput.cc.

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

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

Reimplemented from edm::service::ELdestination.

Definition at line 643 of file ELoutput.cc.

References wantSomeContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 634 of file ELoutput.cc.

References wantModule.

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

Reimplemented from edm::service::ELdestination.

Definition at line 645 of file ELoutput.cc.

References wantSerial.

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

Reimplemented from edm::service::ELdestination.

Definition at line 637 of file ELoutput.cc.

References wantSubroutine.

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

Reimplemented from edm::service::ELdestination.

Definition at line 640 of file ELoutput.cc.

References wantText.

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

Reimplemented from edm::service::ELdestination.

Definition at line 631 of file ELoutput.cc.

References wantTimestamp.

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

Reimplemented from edm::service::ELdestination.

Definition at line 649 of file ELoutput.cc.

References wantFullContext.

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

Reimplemented from edm::service::ELdestination.

Definition at line 648 of file ELoutput.cc.

References wantFullContext.

648 { 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().