43 if (
c.substr(0, 4) !=
"Run:")
45 std::istringstream is(
c);
51 if (runWord !=
"Run:")
55 is >> eventWord >>
event;
58 if (eventWord !=
"Event:")
60 std::ostringstream os;
79 printAtTermination(
true) {
80 #ifdef ELstatisticsCONSTRUCTOR_TRACE
81 std::cerr <<
"Constructor for ELstatistics()\n";
88 #ifdef ELstatisticsCONSTRUCTOR_TRACE
89 std::cerr <<
"Constructor for ELstatistics(osp)\n";
96 tableLimit(spaceLimit),
100 printAtTermination(
true) {
101 #ifdef ELstatisticsCONSTRUCTOR_TRACE
102 std::cerr <<
"Constructor for ELstatistics(spaceLimit)\n";
109 tableLimit(spaceLimit),
113 printAtTermination(
true) {
114 #ifdef ELstatisticsCONSTRUCTOR_TRACE
115 std::cerr <<
"Constructor for ELstatistics(spaceLimit,osp)\n";
122 tableLimit(orig.tableLimit),
124 updatedStats(orig.updatedStats),
125 termStream(orig.termStream),
126 printAtTermination(orig.printAtTermination) {
127 #ifdef ELstatisticsCONSTRUCTOR_TRACE
128 std::cerr <<
"Copy constructor for ELstatistics()\n";
139 #ifdef ELstatisticsCONSTRUCTOR_TRACE
140 std::cerr <<
"Destructor for ELstatistics\n";
153 #ifdef ELstatsLOG_TRACE
154 std::cerr <<
" =:=:=: Log to an ELstatistics\n";
166 ELmap_stats::iterator
s =
stats.find(
msg.xid());
173 #ifdef ELstatsLOG_TRACE
174 std::cerr <<
" =:=:=: Message accounted for in stats \n";
177 (*s).second.add(summarizeContext(
msg.context()),
msg.reactedTo());
180 #ifdef ELstatsLOG_TRACE
189 #ifdef ELstatsLOG_TRACE
190 std::cerr <<
" =:=:=: log(msg) done (stats) \n";
199 ELmap_stats::iterator
s;
202 (*s).second.context1 = (*s).second.context2 = (*s).second.contextLast =
"";
224 std::ostringstream
s;
233 part3() :
n(0
L),
t(0
L) { ; }
238 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
249 s <<
" type category sev module "
250 "subroutine count total\n"
251 <<
" ---- -------------------- -- ---------------- "
252 "---------------- ----- -----\n";
256 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*i).first.id.substr(0, 20) <<
' ' << left
257 << std::setw(2) << (*i).first.severity.getSymbol() <<
' ' << left << std::setw(16)
258 << (*i).first.module.substr(0, 16) <<
' ' << left << std::setw(16) << (*i).first.subroutine.substr(0, 16)
259 << right << std::setw(7) << (*i).second.n << left << std::setw(1) << ((*i).second.ignoredFlag ?
'*' :
' ')
260 << right << std::setw(8) << (*i).second.aggregateN <<
'\n';
261 ftnote = ftnote || (*i).second.ignoredFlag;
273 int groupAggregateN = 0;
275 bool groupIgnored =
true;
276 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
277 if ((*i).first.id == *
g) {
280 groupIgnored &= (*i).second.ignoredFlag;
281 groupAggregateN += (*i).second.aggregateN;
285 if (groupTotal > 0) {
288 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*g).substr(0, 20) <<
' ' << left
289 << std::setw(2) <<
severityLevel.getSymbol() <<
' ' << left << std::setw(16) <<
" <Any Module> " <<
' '
290 << left << std::setw(16) <<
"<Any Function>" << right << std::setw(7) << groupTotal << left << std::setw(1)
291 << (groupIgnored ?
'*' :
' ') << right << std::setw(8) << groupAggregateN <<
'\n';
292 ftnote = ftnote || groupIgnored;
297 p3[lev].n += groupTotal;
298 p3[lev].t += groupAggregateN;
305 s <<
"\n* Some occurrences of this message"
306 " were suppressed in all logs, due to limits.\n";
311 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
318 <<
" type category Examples: "
319 "run/evt run/evt run/evt\n"
320 <<
" ---- -------------------- ----"
321 "------------ ---------------- ----------------\n";
323 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*i).first.id.c_str() <<
' ' << left
324 << std::setw(16) << (*i).second.context1.c_str() <<
' ' << left << std::setw(16)
325 << (*i).second.context2.c_str() <<
' ' << (*i).second.contextLast.c_str() <<
'\n';
330 s <<
"\nSeverity # Occurrences Total Occurrences\n"
331 <<
"-------- ------------- -----------------\n";
335 << std::setw(17) <<
p3[
k].n << right << std::setw(20) <<
p3[
k].t <<
'\n';
350 termStream <<
"\n=============================================\n\n"
351 <<
"MessageLogger Summary" << std::endl
353 <<
"dropped waiting message count " << overfullWaitCount << std::endl
362 return std::map<ELextendedID, StatsCount>(
stats);
369 part3() :
n(0
L),
t(0
L) { ; }
376 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
385 std::ostringstream
s;
387 std::string sevSymbol = (*i).first.severity.getSymbol();
388 if (sevSymbol[0] ==
'-')
389 sevSymbol = sevSymbol.substr(1);
390 s << sevSymbol <<
"_" << (*i).first.id;
391 int n = (*i).second.aggregateN;
393 if (sm.find(catstr) != sm.end()) {
408 int groupAggregateN = 0;
410 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
411 if ((*i).first.id == *
g) {
414 groupAggregateN += (*i).second.aggregateN;
418 if (groupTotal > 0) {
421 std::ostringstream
s;
424 if (sevSymbol[0] ==
'-')
425 sevSymbol = sevSymbol.substr(1);
426 s << sevSymbol <<
"_" << *
g;
427 int n = groupAggregateN;
429 if (sm.find(catstr) != sm.end()) {
438 p3[lev].n += groupTotal;
439 p3[lev].t += groupAggregateN;
452 if (sevName ==
"Severe")
454 if (sevName ==
"Success")
458 if (sevName !=
"UnusedSeverity") {
459 sm[sevName] =
p3[
k].t;
468 return "LogDebug_LogTrace";
470 return "LogInfo_LogVerbatim";
471 if (
s ==
"LogWarning")
472 return "LogWarnng_LogPrint";
474 return "LogError_LogProblem";
475 if (
s ==
"LogSystem")
476 return "LogSystem_LogAbsolute";
477 return "UnusedSeverity";