1 #include "otsdaq/MessageFacility/TRACEController.h"
2 #include "TRACE/trace.h"
4 ots::ITRACEController::HostTraceLevelMap ots::TRACEController::GetTraceLevels()
6 TLOG(TLVL_DEBUG) <<
"Getting TRACE levels";
8 HostTraceLevelMap output;
9 auto hostname = GetHostnameString();
11 unsigned ee = traceControl_p->num_namLvlTblEnts;
12 for(
unsigned ii = 0; ii < ee; ++ii)
14 if(traceNamLvls_p[ii].name[0])
16 std::string name = std::string(traceNamLvls_p[ii].name);
17 output[hostname][name].M = traceNamLvls_p[ii].M;
18 output[hostname][name].S = traceNamLvls_p[ii].S;
19 output[hostname][name].T = traceNamLvls_p[ii].T;
25 void ots::TRACEController::SetTraceLevelMask(std::string name, TraceMasks
const& lvl, std::string hostname)
27 if(hostname !=
"localhost" && hostname != GetHostnameString())
29 TLOG(TLVL_WARNING) <<
"TRACEController asked to set TRACE levels for host " << hostname <<
", but this is " << GetHostnameString() <<
"!";
32 TLOG(TLVL_DEBUG) <<
"Setting levels for name " << name <<
" to " << std::hex << std::showbase << lvl.M <<
" " << lvl.S <<
" " << lvl.T;
35 TRACE_CNTL(
"lvlmsknM", name.c_str(), lvl.M);
36 TRACE_CNTL(
"lvlmsknS", name.c_str(), lvl.S);
37 TRACE_CNTL(
"lvlmsknT", name.c_str(), lvl.T);
41 TRACE_CNTL(
"lvlmskMg", lvl.M);
42 TRACE_CNTL(
"lvlmskSg", lvl.S);
43 TRACE_CNTL(
"lvlmskTg", lvl.T);