DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
OpMonFacility.cpp
Go to the documentation of this file.
1
8
10#include "logging/Logging.hpp"
11
12using namespace dunedaq::opmonlib;
13
14std::shared_ptr<OpMonFacility>
16{
17
18 TLOG() << "FACILITY = " << facility;
19
20 const std::string hook = "://";
21 auto sep = facility.find(hook);
22 std::string scheme;
23 if (sep == std::string::npos) { // simple path
24 scheme = "stdout";
25 } else { // with scheme
26 scheme = facility.substr(0, sep);
27 }
28
29 std::string plugin_name = scheme + "OpMonFacility";
30 static cet::BasicPluginFactory bpf("duneOpMonFacility", "make");
31 std::shared_ptr<OpMonFacility> os_ptr;
32
33 try {
34 os_ptr = bpf.makePlugin<std::shared_ptr<OpMonFacility>>(plugin_name, facility, o);
35 } catch (const ers::Issue& iexpt) {
36 throw OpMonFacilityCreationFailed(ERS_HERE, plugin_name, iexpt);
37 } catch (const cet::exception& cexpt) {
38 throw OpMonFacilityCreationFailedWithCause(ERS_HERE, plugin_name, cexpt.what());
39 } catch (...) { // NOLINT JCF Jan-27-2021 violates letter of the law but not the spirit
40 throw OpMonFacilityCreationFailed(ERS_HERE, plugin_name);
41 }
42 return os_ptr;
43}
#define ERS_HERE
Base class for any user define issue.
Definition Issue.hpp:76
#define TLOG(...)
Definition macro.hpp:21
std::shared_ptr< OpMonFacility > makeOpMonFacility(std::string const &facility, OptionalOrigin=OptionalOrigin())
std::optional< dunedaq::opmon::OpMonId > OptionalOrigin