|
![CMS Logo](/cmsdoxygen/common/rightImage.jpg) |
Go to the documentation of this file.
100 static char const dummy[] =
"dd-Mon-yyyy hh:mm:ss TZN ";
101 char ts[
sizeof(
dummy)];
105 strftime(ts,
sizeof(
dummy),
"%d-%b-%Y %H:%M:%S %Z", localtime_r(&
t, &timebuf));
108 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE
111 unsigned int b = strlen(ts);
112 while (ts[--
b] ==
' ') {
132 wantSubroutine(
true),
134 wantSomeContext(
true),
136 wantFullContext(
false),
137 wantTimeSeparate(
false),
138 wantEpilogueSeparate(
false),
141 #ifdef ELoutputCONSTRUCTOR_TRACE
142 std::cerr <<
"Constructor for ELoutput()\n";
145 emitToken(
"\n=================================================",
true);
146 emitToken(
"\nMessage Log File written by MessageLogger service \n");
147 emitToken(
"\n=================================================\n",
true);
158 wantSubroutine(
true),
160 wantSomeContext(
true),
162 wantFullContext(
false),
163 wantTimeSeparate(
false),
164 wantEpilogueSeparate(
false),
167 #ifdef ELoutputCONSTRUCTOR_TRACE
168 std::cerr <<
"Constructor for ELoutput( os )\n";
174 emitToken(
"\n=================================================",
true);
175 emitToken(
"\nMessage Log File written by MessageLogger service \n");
176 emitToken(
"\n=================================================\n",
true);
188 wantSubroutine(
true),
190 wantSomeContext(
true),
192 wantFullContext(
false),
193 wantTimeSeparate(
false),
194 wantEpilogueSeparate(
false),
197 #ifdef ELoutputCONSTRUCTOR_TRACE
203 #ifdef ELoutputCONSTRUCTOR_TRACE
204 std::cerr <<
" Testing if os is owned\n";
206 #ifdef ELoutputCONSTRUCTOR_TRACE
207 std::cerr <<
" About to do first emit\n";
211 emitToken(
"\n=======================================================",
true);
217 #ifdef ELoutputCONSTRUCTOR_TRACE
221 #ifdef ELoutputCONSTRUCTOR_TRACE
225 emitToken(
"\n=======================================================",
true);
226 emitToken(
"\n%MSG** Logging to cerr is being substituted");
229 emitToken(
"\" which could not be opened for write or append.\n");
235 emitToken(
"\n=======================================================\n",
true);
239 #ifdef ELoutputCONSTRUCTOR_TRACE
240 std::cerr <<
"Constructor for ELoutput completed.\n";
248 charsOnLine(orig.charsOnLine),
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)
261 #ifdef ELoutputCONSTRUCTOR_TRACE
262 std::cerr <<
"Copy constructor for ELoutput\n";
282 #ifdef ELoutputCONSTRUCTOR_TRACE
283 std::cerr <<
"Destructor for ELoutput\n";
296 #ifdef ELoutputTRACE_LOG
297 std::cerr <<
" =:=:=: Log to an ELoutput \n";
303 std::cerr <<
" =:=:=: Log to an ELoutput \n"
306 <<
" id = " <<
xid.
id <<
"\n";
319 #ifdef ELoutputTRACE_LOG
320 std::cerr <<
" =:=:=: Limits table work done \n";
327 if (!
msg.is_verbatim()) {
337 #ifdef ELoutputTRACE_LOG
342 if (!
msg.is_verbatim()) {
344 std::ostringstream
s;
350 #ifdef OUTPUT_FORMATTED_ERROR_MESSAGES
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';
366 bool needAspace =
true;
367 if (!
msg.is_verbatim()) {
393 #ifdef ELoutputTRACE_LOG
394 std::cerr <<
" =:=:=: Module and Subroutine done \n";
399 if (!
msg.is_verbatim()) {
414 #ifdef ELoutputTRACE_LOG
415 std::cerr <<
" =:=:=: TimeStamp done \n";
420 if (!
msg.is_verbatim()) {
429 #ifdef ELoutputTRACE_LOG
430 std::cerr <<
" =:=:=: fullContext done: \n";
434 #ifdef ELoutputTRACE_LOG
444 bool insertNewlineAfterHeader = (
msg.xid().severity !=
ELdebug);
447 if (!
msg.is_verbatim()) {
454 #ifdef ELoutputTRACE_LOG
455 std::cerr <<
" =:=:=: Trace routine done: \n";
458 #ifndef OUTPUT_FORMATTED_ERROR_MESSAGES
463 ELlist_string::const_iterator it;
465 for (it =
msg.items().begin(); it !=
msg.items().end(); ++it) {
466 #ifdef ELoutputTRACE_LOG
467 std::cerr <<
" =:=:=: Item: " << *it <<
'\n';
470 if (!
msg.is_verbatim()) {
471 if (!insertNewlineAfterHeader && (item_count == 3)) {
487 if (!
msg.is_verbatim()) {
497 #ifdef ELoutputTRACE_LOG
498 std::cerr <<
" =:=:=: log(msg) done: \n";
512 #ifdef ELoutput_EMIT_TRACE
514 std::cerr <<
"[][][] in emit: s.length() " <<
s.length() <<
'\n';
518 if (
s.length() == 0) {
520 (*os) <<
newline << std::flush;
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];
537 #ifdef ELoutput_EMIT_TRACE
538 std::cerr <<
"[][][] in emit: about to << to *os \n";
540 #ifdef HEADERS_BROKEN_INTO_LINES_AND_INDENTED
552 (*os) <<
s.substr(1);
557 #ifdef ELoutput_EMIT_TRACE
558 std::cerr <<
"[][][] in emit: about to << s to *os: " <<
s <<
" \n";
564 if (
last ==
'\n' || last2 ==
'\n') {
572 (*os) <<
newline << std::flush;
583 #ifdef ELoutput_EMIT_TRACE
584 std::cerr <<
"[][][] in emit: completed \n";
626 emitToken(
"\n=======================================================",
true);
627 emitToken(
"\nError Log changed to this stream\n");
630 emitToken(
"\n=======================================================\n",
true);
635 emitToken(
"\n=======================================================",
true);
636 emitToken(
"\nError Log changed to this file\n");
639 emitToken(
"\n=======================================================\n",
true);
void emitToken(const ELstring &s, bool nl=false)
void useContext() override
void suppressSubroutine() override
void changeFile(std::ostream &os) override
bool log(const edm::ErrorObj &msg) override
std::unordered_set< std::string > respondToThese
ELseverityLevel traceThreshold
void includeContext() override
static ELstring formatTime(const time_t t)
U second(std::pair< T, U > const &p)
void includeSubroutine() override
void includeModule() override
const ELstring getSymbol() const
void suppressSerial() override
T first(std::pair< T, U > const &p)
void suppressTime() override
virtual bool thisShouldBeIgnored(const ELstring &s) const
void includeSerial() override
void attachTime() override
std::shared_ptr< std::ostream > os
bool respondToMostModules
const ELslProxy< ELsevereGen > ELsevere
const ELslProxy< ELdebugGen > ELdebug
void separateTime() override
bool add(const ELextendedID &xid)
void suppressContext() override
void attachEpilogue() override
void includeText() override
bool wantEpilogueSeparate
ELseverityLevel threshold
void suppressModule() override
void useFullContext() override
void suppressText() override
void includeTime() override
void separateEpilogue() override
std::unordered_set< std::string > ignoreThese