CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/EventFilter/Message2log4cplus/interface/ELlog4cplus.h

Go to the documentation of this file.
00001 #ifndef EventFilter_ELlog4cplus_h
00002 #define EventFilter_ELlog4cplus_h 2
00003 
00004 // ----------------------------------------------------------------------
00005 //
00006 // ELoutput     is a subclass of ELdestination representing the standard
00007 //              provided destination.
00008 //
00009 // 7/8/98 mf    Created file.
00010 // 6/17/99 jvr  Made output format options available for ELdestControl only
00011 // 7/2/99 jvr   Added separate/attachTime, Epilogue, and Serial options
00012 // 2/22/00 mf   Changed myDetX to myOutputX (to avoid future puzzlement!)
00013 //              and added ELoutput(ox) to cacilitate inherited classes.
00014 // 6/7/00 web   Consolidated ELoutput/X; add filterModule()
00015 // 6/14/00 web  Declare classes before granting friendship; remove using
00016 // 10/4/00 mf   add excludeModule()
00017 //  4/4/01 mf   Removed moduleOfInterest and moduleToExclude, in favor
00018 //              of using base class method.
00019 //  6/23/03 mf  changeFile(), flush() 
00020 //
00021 // ----------------------------------------------------------------------
00022 
00023 #include <sstream>
00024 
00025 
00026 #include "FWCore/MessageLogger/interface/ELstring.h"
00027 #include "FWCore/MessageLogger/interface/ELextendedID.h"
00028 #include "FWCore/MessageService/interface/ELdestination.h"
00029 
00030 #include "EventFilter/Utilities/interface/RunBase.h"
00031 
00032 namespace xdaq {
00033   class Application;
00034 }
00035 
00036 namespace edm {       
00037 
00038 
00039 // ----------------------------------------------------------------------
00040 // prerequisite classes:
00041 // ----------------------------------------------------------------------
00042 
00043 class ErrorObj;
00044 class ELdestControl;
00045 
00046 
00047 // ----------------------------------------------------------------------
00048 // ELoutput:
00049 // ----------------------------------------------------------------------
00050 
00051 class ELlog4cplus : public service::ELdestination, public evf::RunBase  {
00052 
00053   friend class service::ELdestControl;
00054 
00055 public:
00056 
00057   // ---  Birth/death:
00058   //
00059   ELlog4cplus();
00060   ELlog4cplus( const ELlog4cplus & orig );
00061   virtual ~ELlog4cplus();
00062 
00063   // ---  Methods invoked by the ELadministrator:
00064   //
00065 public:
00066   virtual
00067   ELlog4cplus *
00068   clone() const;
00069   // Used by attach() to put the destination on the ELadministrators list
00070                 //-| There is a note in Design Notes about semantics
00071                 //-| of copying a destination onto the list:  ofstream
00072                 //-| ownership is passed to the new copy.
00073 
00074   virtual bool log( const ErrorObj & msg );
00075 
00076 
00077   // ---  Methods invoked through the ELdestControl handle:
00078   //
00079 protected:
00080     // trivial clearSummary(), wipe(), zero() from base class
00081     // trivial three summary(..) from base class
00082 
00083   // ---  Data affected by methods of specific ELdestControl handle:
00084   //
00085 protected:
00086     // ELlog4cplus uses the generic ELdestControl handle
00087 
00088   // ---  Internal Methods -- Users should not invoke these:
00089   //
00090 protected:
00091   virtual void emit( const ELstring & s, bool nl=false );
00092 
00093   virtual void suppressTime();        virtual void includeTime();
00094   virtual void suppressModule();      virtual void includeModule();
00095   virtual void suppressSubroutine();  virtual void includeSubroutine();
00096   virtual void suppressText();        virtual void includeText();
00097   virtual void suppressContext();     virtual void includeContext();
00098   virtual void suppressSerial();      virtual void includeSerial();
00099   virtual void useFullContext();      virtual void useContext();
00100   virtual void separateTime();        virtual void attachTime();
00101   virtual void separateEpilogue();    virtual void attachEpilogue();
00102 
00103   virtual void summarization ( const ELstring & fullTitle
00104                              , const ELstring & sumLines );
00105                              
00106 
00107   // ---  Maintenance and Testing Methods -- Users should not invoke these:
00108   //
00109 public:
00110   void xxxxSet( int i );  // Testing only
00111   void xxxxShout();       // Testing only
00112   void setAppl(xdaq::Application *a);
00113 
00114 protected:
00115   // --- member data:
00116   //
00117   std::ostringstream os_;
00118   std::ostringstream *  os;
00119   bool            osIsOwned;
00120   int             charsOnLine;
00121   ELextendedID    xid;
00122 
00123   bool wantTimestamp
00124   ,    wantModule
00125   ,    wantSubroutine
00126   ,    wantText
00127   ,    wantSomeContext
00128   ,    wantSerial
00129   ,    wantFullContext
00130   ,    wantTimeSeparate
00131   ,    wantEpilogueSeparate
00132   ;
00133 
00134   // *** Maintenance and Testing Data ***
00135   int xxxxInt;             // Testing only
00136 
00137   // --- Verboten method:
00138   //
00139   ELlog4cplus & operator=( const ELlog4cplus & orig );
00140 
00141  private:
00142 
00143   xdaq::Application *appl_;
00144 
00145 };  // ELlog4cplus
00146 
00147 
00148 // ----------------------------------------------------------------------
00149 
00150 
00151 }        // end of namespace edm
00152 
00153 
00154 #endif // ELlog4cplus_h