Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-30 02:33:05

0001 #ifndef FWCore_MessageService_ELdestination_h
0002 #define FWCore_MessageService_ELdestination_h
0003 
0004 // ----------------------------------------------------------------------
0005 //
0006 // ELdestination   is a virtual class defining the interface to a
0007 //         destination.  Concrete classes derived from this include
0008 //         ELoutput and ELstatistics.  The ELadministrator owns
0009 //         a list of ELdestination* as well as the objects those
0010 //         list elements point to.
0011 //
0012 // 7/5/98 mf    Created file.
0013 // 6/16/99 jvr  Allows suppress/include options on destinations
0014 // 7/1/99 mf    Forward-declared ELdestControl for strict C++ (thanks cg).
0015 // 7/2/99  jvr  Added separate/attachTime, Epilogue, and Serial options
0016 // 12/20/99 mf  Added virtual destructor.
0017 // 6/7/00  web  Consolidated ELdestination/X; add filterModule()
0018 // 6/14/00 web  Declare classes before granting friendship.
0019 // 10/4/00 mf   Add excludeModule
0020 // 1/15/01 mf   setLineLength()
0021 // 2/13/01 mf   fix written by pc to accomodate NT problem with
0022 //      static init { $001$ }.  Corresponding fix is in .cc file.
0023 // 3/13/01 mf   statisticsMap()
0024 // 04/04/01 mf  add ignoreMOdule and respondToModule
0025 // 6/23/03 mf   changeFile() and flush()
0026 // 1/10/06 mf   finish
0027 // 6/19/08 mf   summaryForJobReport()
0028 //
0029 // ----------------------------------------------------------------------
0030 
0031 #include "FWCore/MessageService/src/ELlimitsTable.h"
0032 
0033 #include "FWCore/MessageLogger/interface/ErrorObj.h"
0034 #include "FWCore/MessageLogger/interface/ELextendedID.h"
0035 
0036 #include <unordered_set>
0037 #include <string>
0038 
0039 namespace edm {
0040   namespace service {
0041 
0042     // ----------------------------------------------------------------------
0043     // prerequisite classes:
0044     // ----------------------------------------------------------------------
0045 
0046     class ELadministrator;
0047 
0048     // ----------------------------------------------------------------------
0049     // ELdestination:
0050     // ----------------------------------------------------------------------
0051 
0052     class ELdestination {
0053       friend class ELadministrator;
0054 
0055     public:
0056       ELdestination();
0057       ELdestination(const ELdestination& orig) = delete;
0058       ELdestination& operator=(const ELdestination& orig) = delete;
0059       virtual ~ELdestination();
0060 
0061       // -----  Methods invoked by the ELadministrator:
0062       //
0063     public:
0064       virtual bool log(const edm::ErrorObj& msg);
0065 
0066       virtual std::string getNewline() const;
0067 
0068       virtual void finish();
0069 
0070       // -----  Behavior control methods invoked by the framework:
0071       //
0072       void setThreshold(const messagelogger::ELseverityLevel& sv);
0073       void setTraceThreshold(const messagelogger::ELseverityLevel& sv);
0074       void setLimit(const std::string& s, int n);
0075       void setLimit(const messagelogger::ELseverityLevel& sv, int n);
0076       void setInterval(const std::string& s, int interval);
0077       void setInterval(const messagelogger::ELseverityLevel& sv, int interval);
0078       void setTimespan(const std::string& s, int n);
0079       void setTimespan(const messagelogger::ELseverityLevel& sv, int n);
0080 
0081       // -----  Select output format options:
0082       //
0083       virtual void suppressText();
0084       virtual void includeText();  // $$ jvr
0085       virtual void suppressModule();
0086       virtual void includeModule();
0087       virtual void suppressSubroutine();
0088       virtual void includeSubroutine();
0089       virtual void suppressTime();
0090       virtual void includeTime();
0091       virtual void suppressContext();
0092       virtual void includeContext();
0093       virtual void suppressSerial();
0094       virtual void includeSerial();
0095       virtual void useFullContext();
0096       virtual void useContext();
0097       virtual void separateTime();
0098       virtual void attachTime();
0099       virtual void separateEpilogue();
0100       virtual void attachEpilogue();
0101       virtual int setLineLength(int len);
0102       virtual int getLineLength() const;
0103 
0104       virtual void wipe();
0105       virtual void zero();
0106       virtual void filterModule(std::string const& moduleName);
0107       virtual void excludeModule(std::string const& moduleName);
0108       virtual void ignoreModule(std::string const& moduleName);
0109       virtual void respondToModule(std::string const& moduleName);
0110       virtual bool thisShouldBeIgnored(std::string const& s) const;
0111 
0112       virtual void setTableLimit(int n);
0113 
0114       virtual void changeFile(std::ostream& os);
0115       virtual void changeFile(const std::string& filename);
0116       virtual void flush();
0117 
0118     protected:
0119       messagelogger::ELseverityLevel threshold;
0120       messagelogger::ELseverityLevel traceThreshold;
0121       ELlimitsTable limits;
0122       std::string preamble;
0123       std::string newline;
0124       std::string indent;
0125       int lineLength;
0126       bool respondToMostModules;
0127       bool ignoreMostModules;
0128       std::unordered_set<std::string> respondToThese;
0129       std::unordered_set<std::string> ignoreThese;
0130       // Fix $001 2/13/01 mf
0131 #ifndef DEFECT_NO_STATIC_CONST_INIT
0132       static const int defaultLineLength = 80;
0133 #else
0134       static const int defaultLineLength;
0135 #endif
0136 
0137       // -----  Verboten methods:
0138       //
0139     };  // ELdestination
0140 
0141     struct close_and_delete {
0142       void operator()(std::ostream* os) const;
0143     };
0144 
0145   }  // end of namespace service
0146 }  // end of namespace edm
0147 
0148 #endif  // FWCore_MessageService_ELdestination_h