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