5 #include "cetlib/sqlite/ConnectionFactory.h" 6 #include "cetlib/sqlite/Ntuple.h" 25 ConnectionFactory factory;
40 sqlite3Plugin(Parameters
const&);
49 void routePayload(ostringstream
const&,
mf::ErrorObj const&)
override;
52 std::unique_ptr<Connection> connection_;
65 sqlite3Plugin::~sqlite3Plugin()
71 sqlite3Plugin::sqlite3Plugin(Parameters
const& ps)
72 : ELdestination{ps().elDestConfig()}
73 , connection_{factory.make_connection(ps().
filename())}
74 , msgTable_{
new Ntuple<string,
98 sqlite3Plugin::routePayload(ostringstream
const& oss,
mf::ErrorObj const& msg)
100 auto const& xid = msg.
xid();
101 string const& timestamp = format_.timestamp(msg.
timestamp());
102 string const& hostname = xid.
hostname();
103 string const& hostaddr = xid.hostaddr();
104 string const& severity = xid.severity().getName();
105 string const& category = xid.id();
106 string const& app = xid.application();
107 long const&
pid = xid.pid();
109 string const& modname = xid.module();
110 string const& usrMsg =
111 !oss.str().compare(0, 1,
"\n") ? oss.str().erase(0, 1) : oss.str();
112 msgTable_->insert(timestamp,
128 return make_unique<sqlite3Plugin>(pset);
timeval timestamp() const
fhicl::Atom< std::string > filename
ELextendedID const & xid() const
string const & GetIteration()
#define FHICL_PROVIDE_ALLOWED_CONFIGURATION(klass)
MAKE_MFPLUGIN_START(, pset)
std::string const & hostname() const