3 #include "cetlib/PluginTypeDeducer.h" 4 #include "cetlib/ProvideFilePathMacro.h" 5 #include "cetlib/ProvideMakePluginMacros.h" 6 #include "cetlib/sqlite/ConnectionFactory.h" 7 #include "cetlib/sqlite/Ntuple.h" 28 ConnectionFactory factory;
43 sqlite3Plugin(Parameters
const&);
52 void routePayload(ostringstream
const&,
mf::ErrorObj const&)
override;
55 Connection connection_;
68 sqlite3Plugin::~sqlite3Plugin()
74 sqlite3Plugin::sqlite3Plugin(Parameters
const& ps)
75 : ELdestination{ps().elDestConfig()}
76 , connection_{factory.make(ps().
filename())}
77 , msgTable_{
new Ntuple<string,
101 sqlite3Plugin::routePayload(ostringstream
const& oss,
mf::ErrorObj const& msg)
103 auto const& xid = msg.
xid();
104 string const& timestamp = format_.timestamp(msg.
timestamp());
105 string const& hostname = xid.
hostname();
106 string const& hostaddr = xid.hostaddr();
107 string const& severity = xid.severity().getName();
108 string const& category = xid.id();
109 string const& app = xid.application();
110 long const&
pid = xid.pid();
112 string const& modname = xid.module();
113 string const& usrMsg =
114 !oss.str().compare(0, 1,
"\n") ? oss.str().erase(0, 1) : oss.str();
115 msgTable_->insert(timestamp,
131 return make_unique<sqlite3Plugin>(pset);
135 CET_PROVIDE_FILE_PATH()
fhicl::Atom< std::string > filename
timeval timestamp() const
ELextendedID const & xid() const
string const & GetIteration()
#define FHICL_PROVIDE_ALLOWED_CONFIGURATION(klass)
MAKE_PLUGIN_START(auto, string const &, fhicl::ParameterSet const &pset)
std::string const & hostname() const