54 printAtTermination(
true) {
55 #ifdef ELstatisticsCONSTRUCTOR_TRACE
56 std::cerr <<
"Constructor for ELstatistics()\n";
63 #ifdef ELstatisticsCONSTRUCTOR_TRACE
64 std::cerr <<
"Constructor for ELstatistics(osp)\n";
71 tableLimit(spaceLimit),
75 printAtTermination(
true) {
76 #ifdef ELstatisticsCONSTRUCTOR_TRACE
77 std::cerr <<
"Constructor for ELstatistics(spaceLimit)\n";
84 tableLimit(spaceLimit),
88 printAtTermination(
true) {
89 #ifdef ELstatisticsCONSTRUCTOR_TRACE
90 std::cerr <<
"Constructor for ELstatistics(spaceLimit,osp)\n";
97 tableLimit(orig.tableLimit),
99 updatedStats(orig.updatedStats),
100 termStream(orig.termStream),
101 printAtTermination(orig.printAtTermination) {
102 #ifdef ELstatisticsCONSTRUCTOR_TRACE
103 std::cerr <<
"Copy constructor for ELstatistics()\n";
114 #ifdef ELstatisticsCONSTRUCTOR_TRACE
115 std::cerr <<
"Destructor for ELstatistics\n";
128 if (
c.substr(0, 4) !=
"Run:")
130 std::istringstream is(
c);
133 is >> runWord >>
run;
136 if (runWord !=
"Run:")
140 is >> eventWord >>
event;
143 if (eventWord !=
"Event:")
145 std::ostringstream os;
151 #ifdef ELstatsLOG_TRACE
152 std::cerr <<
" =:=:=: Log to an ELstatistics\n";
164 ELmap_stats::iterator
s =
stats.find(
msg.xid());
171 #ifdef ELstatsLOG_TRACE
172 std::cerr <<
" =:=:=: Message accounted for in stats \n";
178 #ifdef ELstatsLOG_TRACE
187 #ifdef ELstatsLOG_TRACE
188 std::cerr <<
" =:=:=: log(msg) done (stats) \n";
197 ELmap_stats::iterator
s;
200 (*s).second.context1 = (*s).second.context2 = (*s).second.contextLast =
"";
222 std::ostringstream
s;
231 part3() :
n(0
L),
t(0
L) { ; }
236 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
247 s <<
" type category sev module "
248 "subroutine count total\n"
249 <<
" ---- -------------------- -- ---------------- "
250 "---------------- ----- -----\n";
254 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*i).first.id.substr(0, 20) <<
' ' << left
255 << std::setw(2) << (*i).first.severity.getSymbol() <<
' ' << left << std::setw(16)
256 << (*i).first.module.substr(0, 16) <<
' ' << left << std::setw(16) << (*i).first.subroutine.substr(0, 16)
257 << right << std::setw(7) << (*i).second.n << left << std::setw(1) << ((*i).second.ignoredFlag ?
'*' :
' ')
258 << right << std::setw(8) << (*i).second.aggregateN <<
'\n';
259 ftnote = ftnote || (*i).second.ignoredFlag;
271 int groupAggregateN = 0;
273 bool groupIgnored =
true;
274 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
275 if ((*i).first.id == *
g) {
278 groupIgnored &= (*i).second.ignoredFlag;
279 groupAggregateN += (*i).second.aggregateN;
283 if (groupTotal > 0) {
286 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*g).substr(0, 20) <<
' ' << left
287 << std::setw(2) <<
severityLevel.getSymbol() <<
' ' << left << std::setw(16) <<
" <Any Module> " <<
' '
288 << left << std::setw(16) <<
"<Any Function>" << right << std::setw(7) << groupTotal << left << std::setw(1)
289 << (groupIgnored ?
'*' :
' ') << right << std::setw(8) << groupAggregateN <<
'\n';
290 ftnote = ftnote || groupIgnored;
295 p3[lev].n += groupTotal;
296 p3[lev].t += groupAggregateN;
303 s <<
"\n* Some occurrences of this message"
304 " were suppressed in all logs, due to limits.\n";
309 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
316 <<
" type category Examples: "
317 "run/evt run/evt run/evt\n"
318 <<
" ---- -------------------- ----"
319 "------------ ---------------- ----------------\n";
321 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*i).first.id.c_str() <<
' ' << left
322 << std::setw(16) << (*i).second.context1.c_str() <<
' ' << left << std::setw(16)
323 << (*i).second.context2.c_str() <<
' ' << (*i).second.contextLast.c_str() <<
'\n';
328 s <<
"\nSeverity # Occurrences Total Occurrences\n"
329 <<
"-------- ------------- -----------------\n";
333 << std::setw(17) <<
p3[
k].n << right << std::setw(20) <<
p3[
k].t <<
'\n';
348 termStream <<
"\n=============================================\n\n"
349 <<
"MessageLogger Summary" << std::endl
351 <<
"dropped waiting message count " << overfullWaitCount << std::endl
360 return std::map<ELextendedID, StatsCount>(
stats);
367 part3() :
n(0
L),
t(0
L) { ; }
374 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
383 std::ostringstream
s;
385 std::string sevSymbol = (*i).first.severity.getSymbol();
386 if (sevSymbol[0] ==
'-')
387 sevSymbol = sevSymbol.substr(1);
388 s << sevSymbol <<
"_" << (*i).first.id;
389 int n = (*i).second.aggregateN;
391 if (sm.find(catstr) != sm.end()) {
406 int groupAggregateN = 0;
408 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
409 if ((*i).first.id == *
g) {
412 groupAggregateN += (*i).second.aggregateN;
416 if (groupTotal > 0) {
419 std::ostringstream
s;
422 if (sevSymbol[0] ==
'-')
423 sevSymbol = sevSymbol.substr(1);
424 s << sevSymbol <<
"_" << *
g;
425 int n = groupAggregateN;
427 if (sm.find(catstr) != sm.end()) {
436 p3[lev].n += groupTotal;
437 p3[lev].t += groupAggregateN;
450 if (sevName ==
"Severe")
452 if (sevName ==
"Success")
456 if (sevName !=
"UnusedSeverity") {
457 sm[sevName] =
p3[
k].t;
466 return "LogDebug_LogTrace";
468 return "LogInfo_LogVerbatim";
469 if (
s ==
"LogWarning")
470 return "LogWarnng_LogPrint";
472 return "LogError_LogProblem";
473 if (
s ==
"LogSystem")
474 return "LogSystem_LogAbsolute";
475 return "UnusedSeverity";