ELostreamOutput.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
4 using namespace std;
5 
6 namespace mf::service {
7 
8  ELostreamOutput::~ELostreamOutput() = default;
9  ELostreamOutput::ELostreamOutput(Parameters const& ps,
10  ostream& os,
11  bool const emitAtStart)
12  : ELostreamOutput{ps, cet::ostream_handle{os}, emitAtStart}
13  {}
14 
17  bool const emitAtStart)
18  : ELostreamOutput{ps(), move(h), emitAtStart}
19  {}
20 
23  bool const emitAtStart)
24  : ELdestination{config.elDestConfig()}, osh{move(h)}
25  {
26  if (emitAtStart) {
27  emitToken(
28  osh, "\n=================================================", true, true);
29  emitToken(osh,
30  "\nMessage Log File written by MessageLogger service\n",
31  false,
32  true);
33  emitToken(osh,
34  "\n=================================================\n",
35  true,
36  true);
37  }
38  }
39 
40  void
41  ELostreamOutput::routePayload(ostringstream const& oss, mf::ErrorObj const&)
42  {
43  osh << oss.str();
44  osh.flush();
45  }
46 
47 } // namespace mf::service
void emitToken(std::ostream &os, std::string const &s, bool nl=false, bool preambleMode=false)
STL namespace.
static Config * config
Definition: config.cpp:1054
void routePayload(std::ostringstream const &oss, ErrorObj const &msg) override
def move(depos, offset)
Definition: depos.py:107
static constexpr double ps
Definition: Units.h:99
fhicl::TableFragment< ELdestination::Config > elDestConfig
ELostreamOutput(Parameters const &config, cet::ostream_handle &&, bool emitAtStart=false)