2 #include "TRACE/tracemf.h"
3 #include "artdaq-core/Utilities/configureMessageFacility.hh"
4 #include "artdaq/Application/LoadParameterSet.hh"
5 #include "artdaq/DAQdata/Globals.hh"
9 fhicl::ParameterSet config_ps = LoadParameterSet(config_string);
10 app_name = config_ps.get<std::string>(
"application_name",
"external");
11 std::string mf_app_name = artdaq::setMsgFacAppName(app_name, config_ps.get<
int>(
"id", 0));
12 artdaq::configureMessageFacility(mf_app_name.c_str(), config_ps.get<
bool>(
"debug_logging",
false), config_ps.get<
bool>(
"log_to_console",
true));
13 metricMan->initialize(config_ps.get<fhicl::ParameterSet>(
"metrics", fhicl::ParameterSet()), app_name);
25 if (!initialized_)
return;
26 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::LastPoint);
31 if (!initialized_)
return;
32 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::LastPoint);
37 if (!initialized_)
return;
38 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::LastPoint);
43 if (!initialized_)
return;
44 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::Accumulate);
48 if (!initialized_)
return;
49 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::Accumulate);
53 if (!initialized_)
return;
54 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::Accumulate);
59 if (!initialized_)
return;
60 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::Rate);
64 if (!initialized_)
return;
65 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::Rate);
69 if (!initialized_)
return;
70 metricMan->sendMetric(name, value, unit, level, artdaq::MetricMode::Rate);
75 if (!initialized_)
return;
76 TLOG(TLVL_ERROR, name) << message;
81 if (!initialized_)
return;
82 TLOG(TLVL_WARNING, name) << message;
87 if (!initialized_)
return;
88 TLOG(TLVL_INFO, name) << message;
93 if (!initialized_)
return;
94 TLOG(TLVL_DEBUG, name) << message;
99 if (!initialized_)
return;
100 TLOG(level, name) << message;
void write_error(std::string const &name, std::string const &message)
Write an error message to TRACE, using the TLVL_ERROR level.
void write_trace(int level, std::string const &name, std::string const &message)
Write an error message to TRACE, using the provided level.
~swig_artdaq()
swig_artdaq destructor
static void CleanUpGlobals()
Clean up statically-allocated Manager class instances.
void send_sum_metric(std::string const &name, int level, std::string const &value, std::string const &unit)
Send a metric using the artdaq MetricManager to the configured backends. Metric instances will be sum...
void send_metric(std::string const &name, int level, std::string const &value, std::string const &unit)
Send a metric using the artdaq MetricManager to the configured backends. Only the last point in a rep...
void write_warning(std::string const &name, std::string const &message)
Write an error message to TRACE, using the TLVL_WARNING level.
void write_debug(std::string const &name, std::string const &message)
Write an error message to TRACE, using the TLVL_DEBUG level.
void send_rate_metric(std::string const &name, int level, std::string const &value, std::string const &unit)
Send a metric using the artdaq MetricManager to the configured backends. Metric instances will be sum...
swig_artdaq(std::string const &config_string)
swig_artdaq constructor
void write_info(std::string const &name, std::string const &message)
Write an error message to TRACE, using the TLVL_INFO level.