ELoutput

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
#ifndef FWCore_MessageService_ELoutput_h
#define FWCore_MessageService_ELoutput_h

// ----------------------------------------------------------------------
//
// ELoutput	is a subclass of ELdestination representing the standard
//		provided destination.
//
// 7/8/98 mf	Created file.
// 6/17/99 jvr	Made output format options available for ELdestControl only
// 7/2/99 jvr	Added separate/attachTime, Epilogue, and Serial options
// 2/22/00 mf	Changed myDetX to myOutputX (to avoid future puzzlement!)
//		and added ELoutput(ox) to cacilitate inherited classes.
// 6/7/00 web	Consolidated ELoutput/X; add filterModule()
// 6/14/00 web	Declare classes before granting friendship; remove using
// 10/4/00 mf	add excludeModule()
//  4/4/01 mf 	Removed moduleOfInterest and moduleToExclude, in favor
//		of using base class method.
//  6/23/03 mf  changeFile(), flush()
//  6/11/07 mf  changed default for emitAtStart to false
//
// ----------------------------------------------------------------------

#include "FWCore/MessageService/src/ELdestination.h"

#include "FWCore/MessageLogger/interface/ELextendedID.h"

#include <memory>

namespace edm {

  // ----------------------------------------------------------------------
  // prerequisite classes:
  // ----------------------------------------------------------------------

  class ErrorObj;
  namespace service {

    // ----------------------------------------------------------------------
    // ELoutput:
    // ----------------------------------------------------------------------

    class ELoutput : public ELdestination {
    public:
      // ---  Birth/death:
      //
      ELoutput();
      ELoutput(std::ostream& os, bool emitAtStart = false);  // 6/11/07 mf
      ELoutput(const std::string& fileName, bool emitAtStart = false);
      ELoutput(const ELoutput& orig);
      ELoutput& operator=(const ELoutput& orig) = delete;
      ~ELoutput() override;

      // ---  Methods invoked by the ELadministrator:
      //
    public:
      bool log(const edm::ErrorObj& msg) override;

    protected:
      // trivial clearSummary(), wipe(), zero() from base class
      // trivial three summary(..) from base class

    protected:
      // ---  Internal Methods -- Users should not invoke these:
      //
    protected:
      void emitToken(std::string_view s, bool nl = false);

      void suppressTime() override;
      void includeTime() override;
      void suppressModule() override;
      void includeModule() override;
      void suppressSubroutine() override;
      void includeSubroutine() override;
      void suppressText() override;
      void includeText() override;
      void suppressContext() override;
      void includeContext() override;
      void suppressSerial() override;
      void includeSerial() override;
      void useFullContext() override;
      void useContext() override;
      void separateTime() override;
      void attachTime() override;
      void separateEpilogue() override;
      void attachEpilogue() override;

      void changeFile(std::ostream& os) override;
      void changeFile(const std::string& filename) override;
      void flush() override;

    protected:
      // --- member data:
      //
      std::shared_ptr<std::ostream> os;
      int charsOnLine;
      edm::ELextendedID xid;

      bool wantTimestamp, wantModule, wantSubroutine, wantText, wantSomeContext, wantSerial, wantFullContext,
          wantTimeSeparate, wantEpilogueSeparate, preambleMode;

      // --- Verboten method:
      //

    };  // ELoutput

    // ----------------------------------------------------------------------

  }  // end of namespace service
}  // end of namespace edm

#endif  // FWCore_MessageService_ELoutput_h