102 static char const dummy[] =
"dd-Mon-yyyy hh:mm:ss TZN ";
103 char ts[
sizeof(dummy)];
107 strftime( ts,
sizeof(dummy),
"%d-%b-%Y %H:%M:%S %Z", localtime_r(&t, &timebuf) );
110 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE 113 unsigned int b = strlen(ts);
114 while (ts[--b] ==
' ') {ts[
b] = 0;}
131 , wantTimestamp (
true )
132 , wantModule (
true )
133 , wantSubroutine (
true )
135 , wantSomeContext (
true )
136 , wantSerial (
false )
137 , wantFullContext (
false )
138 , wantTimeSeparate (
false )
139 , wantEpilogueSeparate(
false )
140 , preambleMode (
true )
143 #ifdef ELoutputCONSTRUCTOR_TRACE 144 std::cerr <<
"Constructor for ELoutput()\n";
147 emitToken(
"\n=================================================",
true );
148 emitToken(
"\nMessage Log File written by MessageLogger service \n" );
149 emitToken(
"\n=================================================\n",
true );
171 #ifdef ELoutputCONSTRUCTOR_TRACE 172 std::cerr <<
"Constructor for ELoutput( os )\n";
178 emitToken(
"\n=================================================",
true );
179 emitToken(
"\nMessage Log File written by MessageLogger service \n" );
180 emitToken(
"\n=================================================\n",
true );
203 #ifdef ELoutputCONSTRUCTOR_TRACE 204 std::cerr <<
"Constructor for ELoutput( " << fileName <<
" )\n";
209 #ifdef ELoutputCONSTRUCTOR_TRACE 210 std::cerr <<
" Testing if os is owned\n";
212 #ifdef ELoutputCONSTRUCTOR_TRACE 213 std::cerr <<
" About to do first emit\n";
217 emitToken(
"\n=======================================================",
225 #ifdef ELoutputCONSTRUCTOR_TRACE 229 #ifdef ELoutputCONSTRUCTOR_TRACE 233 emitToken(
"\n=======================================================",
235 emitToken(
"\n%MSG** Logging to cerr is being substituted" );
236 emitToken(
" for specified log file \"" );
238 emitToken(
"\" which could not be opened for write or append.\n" );
244 emitToken(
"\n=======================================================\n",
249 #ifdef ELoutputCONSTRUCTOR_TRACE 250 std::cerr <<
"Constructor for ELoutput completed.\n";
273 #ifdef ELoutputCONSTRUCTOR_TRACE 274 std::cerr <<
"Copy constructor for ELoutput\n";
296 #ifdef ELoutputCONSTRUCTOR_TRACE 297 std::cerr <<
"Destructor for ELoutput\n";
312 #ifdef ELoutputTRACE_LOG 313 std::cerr <<
" =:=:=: Log to an ELoutput \n";
319 std::cerr <<
" =:=:=: Log to an ELoutput \n" 322 <<
" id = " <<
xid.
id <<
"\n";
336 #ifdef ELoutputTRACE_LOG 337 std::cerr <<
" =:=:=: Limits table work done \n";
354 #ifdef ELoutputTRACE_LOG 362 std::ostringstream
s;
368 #ifdef OUTPUT_FORMATTED_ERROR_MESSAGES 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';
384 bool needAspace =
true;
407 #ifdef ELoutputTRACE_LOG 408 std::cerr <<
" =:=:=: Module and Subroutine done \n";
426 #ifdef ELoutputTRACE_LOG 427 std::cerr <<
" =:=:=: TimeStamp done \n";
439 #ifdef ELoutputTRACE_LOG 440 std::cerr <<
" =:=:=: fullContext done: \n";
444 #ifdef ELoutputTRACE_LOG 461 , insertNewlineAfterHeader );
467 #ifdef ELoutputTRACE_LOG 468 std::cerr <<
" =:=:=: Trace routine done: \n";
471 #ifndef OUTPUT_FORMATTED_ERROR_MESSAGES 476 ELlist_string::const_iterator it;
478 for ( it = msg.
items().begin(); it != msg.
items().end(); ++it ) {
479 #ifdef ELoutputTRACE_LOG 480 std::cerr <<
" =:=:=: Item: " << *it <<
'\n';
484 if ( !insertNewlineAfterHeader && (item_count == 3) ) {
513 #ifdef ELoutputTRACE_LOG 514 std::cerr <<
" =:=:=: log(msg) done: \n";
530 #ifdef ELoutput_EMIT_TRACE 532 std::cerr <<
"[][][] in emit: s.length() " << s.length() <<
'\n';
536 if (s.length() == 0) {
538 (*os) <<
newline << std::flush;
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];
557 || (charsOnLine + static_cast<int>(s.length())) >
lineLength ) {
558 #ifdef ELoutput_EMIT_TRACE 559 std::cerr <<
"[][][] in emit: about to << to *os \n";
561 #ifdef HEADERS_BROKEN_INTO_LINES_AND_INDENTED 564 charsOnLine = indent.length();
572 if ( first ==
'\n' ) {
573 (*os) << s.substr(1);
579 #ifdef ELoutput_EMIT_TRACE 580 std::cerr <<
"[][][] in emit: about to << s to *os: " << s <<
" \n";
586 if (last ==
'\n' || last2 ==
'\n') {
590 charsOnLine = indent.length() + 1;
593 if ( nl ) { (*os) <<
newline << std::flush; charsOnLine = 0; }
594 else { charsOnLine += s.length(); }
601 #ifdef ELoutput_EMIT_TRACE 602 std::cerr <<
"[][][] in emit: completed \n";
646 emitToken(
"\n=======================================================",
true );
647 emitToken(
"\nError Log changed to this stream\n" );
650 emitToken(
"\n=======================================================\n",
true );
655 emitToken(
"\n=======================================================",
true );
656 emitToken(
"\nError Log changed to this file\n" );
659 emitToken(
"\n=======================================================\n",
true );
ELslProxy< ELdebugGen > const ELdebug
ELseverityLevel traceThreshold
const ELstring & idOverflow() const
std::unordered_set< std::string > ignoreThese
virtual void suppressText() override
virtual bool thisShouldBeIgnored(const ELstring &s) const
ELseverityLevel threshold
virtual void separateEpilogue() override
U second(std::pair< T, U > const &p)
const ELstring getSymbol() const
static ELstring formatTime(const time_t t)
const ELextendedID & xid() const
virtual void flush() override
virtual void includeModule() override
virtual void includeSubroutine() override
bool add(const ELextendedID &xid)
virtual void includeContext() override
virtual void attachEpilogue() override
virtual void suppressSerial() override
std::unordered_set< std::string > respondToThese
virtual void separateTime() override
virtual void suppressTime() override
std::shared_ptr< std::ostream > os
const ELlist_string & items() const
ELslProxy< ELsevereGen > const ELsevere
virtual void useFullContext() override
virtual void includeSerial() override
void emitToken(const ELstring &s, bool nl=false)
virtual void attachTime() override
virtual void suppressModule() override
virtual void includeTime() override
virtual void useContext() override
bool respondToMostModules
virtual bool log(const edm::ErrorObj &msg) override
bool wantEpilogueSeparate
T first(std::pair< T, U > const &p)
virtual void suppressContext() override
virtual void changeFile(std::ostream &os) override
virtual void includeText() override
virtual void suppressSubroutine() override