103 static char const dummy[] =
"dd-Mon-yyyy hh:mm:ss TZN ";
104 char ts[
sizeof(dummy)];
108 strftime( ts,
sizeof(dummy),
"%d-%b-%Y %H:%M:%S %Z", localtime_r(&t, &timebuf) );
111 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE
114 unsigned int b = strlen(ts);
115 while (ts[--b] ==
' ') {ts[
b] = 0;}
132 , wantTimestamp (
true )
133 , wantModule (
true )
134 , wantSubroutine (
true )
136 , wantSomeContext (
true )
137 , wantSerial (
false )
138 , wantFullContext (
false )
139 , wantTimeSeparate (
false )
140 , wantEpilogueSeparate(
false )
141 , preambleMode (
true )
144 #ifdef ELoutputCONSTRUCTOR_TRACE
145 std::cerr <<
"Constructor for ELoutput()\n";
148 emitToken(
"\n=================================================",
true );
149 emitToken(
"\nMessage Log File written by MessageLogger service \n" );
150 emitToken(
"\n=================================================\n",
true );
160 , wantTimestamp (
true )
161 , wantModule (
true )
162 , wantSubroutine (
true )
164 , wantSomeContext (
true )
165 , wantSerial (
false )
166 , wantFullContext (
false )
167 , wantTimeSeparate (
false )
168 , wantEpilogueSeparate(
false )
169 , preambleMode (
true )
172 #ifdef ELoutputCONSTRUCTOR_TRACE
173 std::cerr <<
"Constructor for ELoutput( os )\n";
179 emitToken(
"\n=================================================",
true );
180 emitToken(
"\nMessage Log File written by MessageLogger service \n" );
181 emitToken(
"\n=================================================\n",
true );
189 , os ( new std::ofstream( fileName.c_str() , std::ios::app),
close_and_delete())
192 , wantTimestamp (
true )
193 , wantModule (
true )
194 , wantSubroutine (
true )
196 , wantSomeContext (
true )
197 , wantSerial (
false )
198 , wantFullContext (
false )
199 , wantTimeSeparate (
false )
200 , wantEpilogueSeparate(
false )
201 , preambleMode (
true )
204 #ifdef ELoutputCONSTRUCTOR_TRACE
205 std::cerr <<
"Constructor for ELoutput( " << fileName <<
" )\n";
210 #ifdef ELoutputCONSTRUCTOR_TRACE
211 std::cerr <<
" Testing if os is owned\n";
213 #ifdef ELoutputCONSTRUCTOR_TRACE
214 std::cerr <<
" About to do first emit\n";
218 emitToken(
"\n=======================================================",
226 #ifdef ELoutputCONSTRUCTOR_TRACE
230 #ifdef ELoutputCONSTRUCTOR_TRACE
234 emitToken(
"\n=======================================================",
236 emitToken(
"\n%MSG** Logging to cerr is being substituted" );
237 emitToken(
" for specified log file \"" );
239 emitToken(
"\" which could not be opened for write or append.\n" );
245 emitToken(
"\n=======================================================\n",
250 #ifdef ELoutputCONSTRUCTOR_TRACE
251 std::cerr <<
"Constructor for ELoutput completed.\n";
260 , charsOnLine ( orig.charsOnLine )
262 , wantTimestamp ( orig.wantTimestamp )
263 , wantModule ( orig.wantModule )
264 , wantSubroutine ( orig.wantSubroutine )
265 , wantText ( orig.wantText )
266 , wantSomeContext ( orig.wantSomeContext )
267 , wantSerial ( orig.wantSerial )
268 , wantFullContext ( orig.wantFullContext )
269 , wantTimeSeparate ( orig.wantTimeSeparate )
270 , wantEpilogueSeparate( orig.wantEpilogueSeparate )
271 , preambleMode ( orig.preambleMode )
274 #ifdef ELoutputCONSTRUCTOR_TRACE
275 std::cerr <<
"Copy constructor for ELoutput\n";
297 #ifdef ELoutputCONSTRUCTOR_TRACE
298 std::cerr <<
"Destructor for ELoutput\n";
320 #ifdef ELoutputTRACE_LOG
321 std::cerr <<
" =:=:=: Log to an ELoutput \n";
327 std::cerr <<
" =:=:=: Log to an ELoutput \n"
330 <<
" id = " <<
xid.
id <<
"\n";
344 #ifdef ELoutputTRACE_LOG
345 std::cerr <<
" =:=:=: Limits table work done \n";
362 #ifdef ELoutputTRACE_LOG
370 std::ostringstream
s;
376 #ifdef OUTPUT_FORMATTED_ERROR_MESSAGES
380 ELlist_string::const_iterator it;
381 for ( it = msg.
items().begin(); it != msg.
items().end(); ++it ) {
382 #ifdef ELoutputTRACE_LOG
383 std::cerr <<
" =:=:=: Item: " << *it <<
'\n';
392 bool needAspace =
true;
415 #ifdef ELoutputTRACE_LOG
416 std::cerr <<
" =:=:=: Module and Subroutine done \n";
434 #ifdef ELoutputTRACE_LOG
435 std::cerr <<
" =:=:=: TimeStamp done \n";
444 #ifdef ELoutputTRACE_LOG
445 std::cerr <<
" =:=:=:>> context supplier is at 0x"
454 #ifdef ELoutputTRACE_LOG
455 std::cerr <<
" =:=:=: fullContext done: \n";
459 #ifdef ELoutputTRACE_LOG
477 , insertNewlineAfterHeader );
483 #ifdef ELoutputTRACE_LOG
484 std::cerr <<
" =:=:=: Trace routine done: \n";
487 #ifndef OUTPUT_FORMATTED_ERROR_MESSAGES
492 ELlist_string::const_iterator it;
494 for ( it = msg.
items().begin(); it != msg.
items().end(); ++it ) {
495 #ifdef ELoutputTRACE_LOG
496 std::cerr <<
" =:=:=: Item: " << *it <<
'\n';
500 if ( !insertNewlineAfterHeader && (item_count == 3) ) {
529 #ifdef ELoutputTRACE_LOG
530 std::cerr <<
" =:=:=: log(msg) done: \n";
546 #ifdef ELoutput_EMIT_TRACE
548 std::cerr <<
"[][][] in emit: s.length() " << s.length() <<
'\n';
552 if (s.length() == 0) {
554 (*os) <<
newline << std::flush;
564 second = (s.length() < 2) ?
'\0' : s[1];
565 last = (s.length() < 2) ?
'\0' : s[s.length()-1];
566 last2 = (s.length() < 3) ?
'\0' : s[s.length()-2];
573 || (charsOnLine + static_cast<int>(s.length())) >
lineLength ) {
574 #ifdef ELoutput_EMIT_TRACE
575 std::cerr <<
"[][][] in emit: about to << to *os \n";
577 #ifdef HEADERS_BROKEN_INTO_LINES_AND_INDENTED
580 charsOnLine = indent.length();
588 if ( first ==
'\n' ) {
589 (*os) << s.substr(1);
595 #ifdef ELoutput_EMIT_TRACE
596 std::cerr <<
"[][][] in emit: about to << s to *os: " << s <<
" \n";
602 if (last ==
'\n' || last2 ==
'\n') {
606 charsOnLine = indent.length() + 1;
609 if ( nl ) { (*os) <<
newline << std::flush; charsOnLine = 0; }
610 else { charsOnLine += s.length(); }
617 #ifdef ELoutput_EMIT_TRACE
618 std::cerr <<
"[][][] in emit: completed \n";
664 const int titleMaxLength( 40 );
696 emitToken(
"\n=======================================================",
true );
697 emitToken(
"\nError Log changed to this stream\n" );
700 emitToken(
"\n=======================================================\n",
true );
705 emitToken(
"\n=======================================================",
true );
706 emitToken(
"\nError Log changed to this file\n" );
709 emitToken(
"\n=======================================================\n",
true );
virtual ELoutput * clone() const
ELseverityLevel traceThreshold
const ELcontextSupplier & getContextSupplier() const
virtual void useFullContext()
const ELstring & idOverflow() const
virtual void separateTime()
virtual void changeFile(std::ostream &os)
ELslProxy< ELsuccessGen > const ELsuccess
virtual bool thisShouldBeIgnored(const ELstring &s) const
virtual void suppressSubroutine()
ELseverityLevel threshold
virtual void suppressContext()
virtual void includeSerial()
boost::shared_ptr< std::ostream > os
virtual void suppressTime()
U second(std::pair< T, U > const &p)
const ELstring getSymbol() const
virtual void attachEpilogue()
static ELstring formatTime(const time_t t)
const ELextendedID & xid() const
bool add(const ELextendedID &xid)
ELset_string respondToThese
virtual void includeSubroutine()
virtual void useContext()
virtual bool log(const edm::ErrorObj &msg)
virtual void includeContext()
virtual void suppressSerial()
virtual void includeTime()
virtual void separateEpilogue()
virtual ELstring context() const =0
virtual void attachTime()
const ELlist_string & items() const
ELslProxy< ELsevereGen > const ELsevere
virtual void emitToken(const ELstring &s, bool nl=false)
static ELadministrator * instance()
virtual void summarization(const ELstring &fullTitle, const ELstring &sumLines)
virtual void suppressModule()
bool respondToMostModules
virtual void suppressText()
virtual void includeText()
bool wantEpilogueSeparate
T first(std::pair< T, U > const &p)
virtual void includeModule()