CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LoggedErrorsSummary.h
Go to the documentation of this file.
1 #ifndef MessageLogger_LoggedErrorsSummaryy_h
2 #define MessageLogger_LoggedErrorsSummaryEntry_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // LoggedErrorsSummary.h - Methods to obtain summary of warning and error
7 // messages issued in an event.
8 //
9 // Usage:
10 // EnableLoggedErrorsSummary();
11 // then per event:
12 // some_code_that_might_issue_messages();
13 // if (edm::FreshErrorsExist()) {
14 // std::vector<edm::ErrorSummaryEntry> es = edm::LoggedErrorsSummary();
15 // package_as_product_in_the_event (es);
16 // }
17 //
18 // The above gives warnings and errors; use LoggedErrorsOnlySummary() for
19 // just errors.
20 //
21 // Note: This goes by severity level. Thus a LogImportant message, though
22 // not intended to convey a problematic error, will appear in the
23 // summary. Also, Absolute and System messages are logged.
24 
25 //
26 // void
27 // package_as_product_in_the_event(std::vector<edm::ErrorSummaryEntry> const& es)
28 // {
29 // // This example shows how to save just errors and not warnings
30 // std::vector<edm::ErrorSummaryEntry> errs;
31 // std::vector<edm::ErrorSummaryEntry>::const_iterator end = es.end();
32 // for (std::vector<edm::ErrorSummaryEntry>::const_iterator i = es.begin();
33 // i != end; ++i) {
34 // if ( i->severity >= edm:ELerror ) errs.push_back(*i);
35 // }
36 // place_into_event(errs);
37 // }
38 //
39 // 25-Aug-2008 mf Created file.
40 //
41 // 22-Jun-2009 mf Added LoggedErrorsOnlySummary()
42 //
43 // ----------------------------------------------------------------------
44 
46 
47 #include <vector>
48 
49 namespace edm {
50 
53 bool FreshErrorsExist();
54 std::vector<ErrorSummaryEntry> LoggedErrorsSummary(); // Errors and Warnings
55 std::vector<ErrorSummaryEntry> LoggedErrorsOnlySummary(); // Errors only
56 
57 } // end of namespace edm
58 
59 
60 #endif // MessageLogger_ErrorSummaryEntry_h
61 
std::vector< ErrorSummaryEntry > LoggedErrorsOnlySummary()
bool EnableLoggedErrorsSummary()
bool DisableLoggedErrorsSummary()
std::vector< ErrorSummaryEntry > LoggedErrorsSummary()
bool FreshErrorsExist()