Changeset 52215d7 in nscp
- Timestamp:
- 02/02/08 20:59:13 (5 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 035c51f
- Parents:
- bf6e9b4
- Files:
-
- 2 edited
-
changelog (modified) (1 diff)
-
modules/CheckEventLog/CheckEventLog.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
changelog
rbf6e9b4 r52215d7 8 8 2008-02-02 MickeM 9 9 * Might have fixed the "missing eventlog messages" problem. 10 + Added %count% parameter to syntax which (when used with unique) will display the numbe of hits for each message displayed. 10 11 11 12 2008-01-27 MickeM -
modules/CheckEventLog/CheckEventLog.cpp
rbf6e9b4 r52215d7 312 312 WORD category; 313 313 public: 314 std::wstring message; 314 315 uniq_eventlog_record(EVENTLOGRECORD *pevlr) : ID(pevlr->EventID&0xffff), type(pevlr->EventType), category(pevlr->EventCategory) {} 315 316 bool operator< (const uniq_eventlog_record &other) const { … … 320 321 } 321 322 }; 322 typedef std::map<uniq_eventlog_record, bool> uniq_eventlog_map;323 typedef std::map<uniq_eventlog_record,unsigned int> uniq_eventlog_map; 323 324 324 325 … … 514 515 } 515 516 if (match&&unique) { 516 uniq_eventlog_record record = pevlr; 517 uniq_eventlog_map::const_iterator cit = uniq_records.find(record); 518 if (cit != uniq_records.end()) { 519 match = false; 517 match = false; 518 uniq_eventlog_record uniq_record = pevlr; 519 uniq_eventlog_map::iterator it = uniq_records.find(uniq_record); 520 if (it != uniq_records.end()) { 521 (*it).second ++; 522 //match = false; 520 523 } 521 else 522 uniq_records[record] = true; 523 } 524 525 if (match) { 524 else { 525 if (!syntax.empty()) { 526 uniq_record.message = record.render(bShowDescriptions, syntax); 527 } else if (!bShowDescriptions) { 528 uniq_record.message = record.eventSource(); 529 } else { 530 uniq_record.message = record.eventSource(); 531 uniq_record.message += _T("(") + EventLogRecord::translateType(record.eventType()) + _T(", ") + 532 strEx::itos(record.eventID()) + _T(", ") + EventLogRecord::translateSeverity(record.severity()) + _T(")"); 533 uniq_record.message += _T("[") + record.enumStrings() + _T("]"); 534 uniq_record.message += _T("{%count%}"); 535 } 536 uniq_records[uniq_record] = 1; 537 } 538 hit_count++; 539 } else if (match) { 526 540 if (!syntax.empty()) { 527 541 strEx::append_list(message, record.render(bShowDescriptions, syntax)); … … 542 556 } 543 557 CloseEventLog(hLog); 558 for (uniq_eventlog_map::const_iterator cit = uniq_records.begin(); cit != uniq_records.end(); ++cit) { 559 std::wstring msg = (*cit).first.message; 560 strEx::replace(msg, _T("%count%"), strEx::itos((*cit).second)); 561 strEx::append_list(message, msg); 562 } 544 563 } 545 564
Note: See TracChangeset
for help on using the changeset viewer.








