Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:43

0001 #ifndef MessageLogger_LoggedErrorsSummary_h
0002 #define MessageLogger_LoggedErrorsSummary_h
0003 
0004 // ----------------------------------------------------------------------
0005 //
0006 // LoggedErrorsSummary.h - Methods to obtain summary of warning and error
0007 //          messages issued in an event.
0008 //
0009 //   Usage:
0010 //  EnableLoggedErrorsSummary();
0011 //  then per event:
0012 //  some_code_that_might_issue_messages();
0013 //  if (edm::FreshErrorsExist()) {
0014 //    std::vector<edm::ErrorSummaryEntry> es = edm::LoggedErrorsSummary();
0015 //    package_as_product_in_the_event (es);
0016 //  }
0017 //
0018 //  The above gives warnings and errors; use LoggedErrorsOnlySummary() for
0019 //  just errors.
0020 //
0021 //  Note:  This goes by severity level.  Thus a LogImportant message, though
0022 //         not intended to convey a problematic error, will appear in the
0023 //         summary.  Also, Absolute and System messages are logged.
0024 
0025 //
0026 //  void
0027 //  package_as_product_in_the_event(std::vector<edm::ErrorSummaryEntry> const& es)
0028 //  {
0029 //    // This example shows how to save just errors and not warnings
0030 //    std::vector<edm::ErrorSummaryEntry> errs;
0031 //    std::vector<edm::ErrorSummaryEntry>::const_iterator end = es.end();
0032 //    for (std::vector<edm::ErrorSummaryEntry>::const_iterator i = es.begin();
0033 //                                                        i != end; ++i) {
0034 //      if ( i->severity >= edm:ELerror ) errs.push_back(*i);
0035 //    }
0036 //    place_into_event(errs);
0037 //  }
0038 //
0039 // 25-Aug-2008 mf   Created file.
0040 //
0041 // 22-Jun-2009 mf   Added LoggedErrorsOnlySummary()
0042 //
0043 // ----------------------------------------------------------------------
0044 
0045 #include "FWCore/MessageLogger/interface/ErrorSummaryEntry.h"
0046 
0047 #include <vector>
0048 
0049 namespace edm {
0050 
0051   bool EnableLoggedErrorsSummary();
0052   bool DisableLoggedErrorsSummary();
0053   bool FreshErrorsExist(unsigned int iStreamID);
0054   std::vector<messagelogger::ErrorSummaryEntry> LoggedErrorsSummary(unsigned int iStreamID);      // Errors and Warnings
0055   std::vector<messagelogger::ErrorSummaryEntry> LoggedErrorsOnlySummary(unsigned int iStreamID);  // Errors only
0056 
0057 }  // end of namespace edm
0058 
0059 #endif  // MessageLogger_LoggedErrorsSummary_h