Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FWCore_MessageService_ELoutput_h
0002 #define FWCore_MessageService_ELoutput_h
0003 
0004 // ----------------------------------------------------------------------
0005 //
0006 // ELoutput is a subclass of ELdestination representing the standard
0007 //      provided destination.
0008 //
0009 // 7/8/98 mf    Created file.
0010 // 6/17/99 jvr  Made output format options available for ELdestControl only
0011 // 7/2/99 jvr   Added separate/attachTime, Epilogue, and Serial options
0012 // 2/22/00 mf   Changed myDetX to myOutputX (to avoid future puzzlement!)
0013 //      and added ELoutput(ox) to cacilitate inherited classes.
0014 // 6/7/00 web   Consolidated ELoutput/X; add filterModule()
0015 // 6/14/00 web  Declare classes before granting friendship; remove using
0016 // 10/4/00 mf   add excludeModule()
0017 //  4/4/01 mf   Removed moduleOfInterest and moduleToExclude, in favor
0018 //      of using base class method.
0019 //  6/23/03 mf  changeFile(), flush()
0020 //  6/11/07 mf  changed default for emitAtStart to false
0021 //
0022 // ----------------------------------------------------------------------
0023 
0024 #include "FWCore/MessageService/src/ELdestination.h"
0025 
0026 #include "FWCore/MessageLogger/interface/ELextendedID.h"
0027 
0028 #include <memory>
0029 
0030 namespace edm {
0031 
0032   // ----------------------------------------------------------------------
0033   // prerequisite classes:
0034   // ----------------------------------------------------------------------
0035 
0036   class ErrorObj;
0037   namespace service {
0038 
0039     // ----------------------------------------------------------------------
0040     // ELoutput:
0041     // ----------------------------------------------------------------------
0042 
0043     class ELoutput : public ELdestination {
0044     public:
0045       // ---  Birth/death:
0046       //
0047       ELoutput();
0048       ELoutput(std::ostream& os, bool emitAtStart = false);  // 6/11/07 mf
0049       ELoutput(const std::string& fileName, bool emitAtStart = false);
0050       ELoutput(const ELoutput& orig);
0051       ELoutput& operator=(const ELoutput& orig) = delete;
0052       ~ELoutput() override;
0053 
0054       // ---  Methods invoked by the ELadministrator:
0055       //
0056     public:
0057       bool log(const edm::ErrorObj& msg) override;
0058 
0059     protected:
0060       // trivial clearSummary(), wipe(), zero() from base class
0061       // trivial three summary(..) from base class
0062 
0063     protected:
0064       // ---  Internal Methods -- Users should not invoke these:
0065       //
0066     protected:
0067       void emitToken(std::string_view s, bool nl = false);
0068 
0069       void suppressTime() override;
0070       void includeTime() override;
0071       void suppressModule() override;
0072       void includeModule() override;
0073       void suppressSubroutine() override;
0074       void includeSubroutine() override;
0075       void suppressText() override;
0076       void includeText() override;
0077       void suppressContext() override;
0078       void includeContext() override;
0079       void suppressSerial() override;
0080       void includeSerial() override;
0081       void useFullContext() override;
0082       void useContext() override;
0083       void separateTime() override;
0084       void attachTime() override;
0085       void separateEpilogue() override;
0086       void attachEpilogue() override;
0087 
0088       void changeFile(std::ostream& os) override;
0089       void changeFile(const std::string& filename) override;
0090       void flush() override;
0091 
0092     protected:
0093       // --- member data:
0094       //
0095       std::shared_ptr<std::ostream> os;
0096       int charsOnLine;
0097       edm::ELextendedID xid;
0098 
0099       bool wantTimestamp, wantModule, wantSubroutine, wantText, wantSomeContext, wantSerial, wantFullContext,
0100           wantTimeSeparate, wantEpilogueSeparate, preambleMode;
0101 
0102       // --- Verboten method:
0103       //
0104 
0105     };  // ELoutput
0106 
0107     // ----------------------------------------------------------------------
0108 
0109   }  // end of namespace service
0110 }  // end of namespace edm
0111 
0112 #endif  // FWCore_MessageService_ELoutput_h