Skip to content

Commit 3d1d961

Browse files
committed
dev: reducing logs
1 parent 0e23762 commit 3d1d961

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

Detectors/CTP/workflowScalers/src/RunManager.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ int CTPRunManager::addScalers(uint32_t irun, std::time_t time, bool start)
216216
}
217217
scalrec.intRecord.bc = 0;
218218
mActiveRuns[irun]->scalers.addScalerRacordRaw(scalrec);
219-
LOG(info) << "Adding scalers for orbit:" << scalrec.intRecord.orbit;
219+
LOG(debug) << "Adding scalers for orbit:" << scalrec.intRecord.orbit;
220220
// scalrec.printStream(std::cout);
221221
// printCounters();
222222
return 0;
223223
}
224224
int CTPRunManager::processMessage(std::string& topic, const std::string& message)
225225
{
226-
LOG(info) << "Processing message with topic:" << topic;
226+
LOG(debug) << "Processing message with topic:" << topic;
227227
std::string firstcounters;
228228
if (topic.find("clear") != std::string::npos) {
229229
mRunsLoaded.clear();
@@ -283,7 +283,7 @@ int CTPRunManager::processMessage(std::string& topic, const std::string& message
283283
// get config
284284
size_t irun = message.find("run");
285285
if (irun == std::string::npos) {
286-
LOG(warning) << "run keyword not found in SOX";
286+
LOG(debug) << "run keyword not found in SOX";
287287
irun = message.size();
288288
}
289289
LOG(info) << "SOX received, Run keyword position:" << irun;
@@ -319,22 +319,22 @@ int CTPRunManager::processMessage(std::string& topic, const std::string& message
319319
}
320320
double timeStamp = std::stold(tokens.at(0));
321321
std::time_t tt = timeStamp;
322-
LOG(info) << "Processing scalers, all good, time:" << tokens.at(0) << " " << std::asctime(std::localtime(&tt));
322+
LOG(debug) << "Processing scalers, all good, time:" << tokens.at(0) << " " << std::asctime(std::localtime(&tt));
323323
for (uint32_t i = 1; i < tokens.size(); i++) {
324324
mCounters[i - 1] = std::stoull(tokens.at(i));
325325
if (i < (NRUNS + 1)) {
326-
std::cout << mCounters[i - 1] << " ";
326+
//std::cout << mCounters[i - 1] << " ";
327327
}
328328
}
329-
std::cout << std::endl;
330-
LOG(info) << "Counter size:" << tokens.size();
329+
//std::cout << std::endl;
330+
LOG(debug) << "Counter size:" << tokens.size();
331331
//
332332
for (uint32_t i = 0; i < NRUNS; i++) {
333333
if ((mCounters[i] == 0) && (mActiveRunNumbers[i] == 0)) {
334334
// not active
335335
} else if ((mCounters[i] != 0) && (mActiveRunNumbers[i] == mCounters[i])) {
336336
// active , do scalers
337-
LOG(info) << "Run continue:" << mCounters[i];
337+
LOG(debug) << "Run continue:" << mCounters[i];
338338
addScalers(i, tt);
339339
// LOG(info) << " QC period:" << mActiveRunNumbers[i] << " " << mActiveRuns[i]->qcwpcount << " " << mQCWritePeriod;
340340
if (mActiveRuns[i]->qcwpcount > mQCWritePeriod) {
@@ -367,7 +367,7 @@ int CTPRunManager::processMessage(std::string& topic, const std::string& message
367367
}
368368
}
369369
mEOX = 0;
370-
printActiveRuns();
370+
//printActiveRuns();
371371
return 0;
372372
}
373373
void CTPRunManager::printActiveRuns() const

Detectors/CTP/workflowScalers/src/ctp-proxy.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ InjectorFunction dcs2dpl(std::string& ccdbhost, std::string& bkhost, std::string
5656
runMgr->setCtpCfgDir(ctpcfgdir);
5757
runMgr->init();
5858
// runMgr->setClient(client);
59+
static int nprint = 0;
5960
return [runMgr](TimingInfo&, ServiceRegistryRef const& services, fair::mq::Parts& parts, ChannelRetriever channelRetriever, size_t newTimesliceId, bool& stop) -> bool {
6061
// FIXME: Why isn't this function using the timeslice index?
6162
// make sure just 2 messages received
@@ -66,7 +67,15 @@ InjectorFunction dcs2dpl(std::string& ccdbhost, std::string& bkhost, std::string
6667
std::string messageHeader{static_cast<const char*>(parts.At(0)->GetData()), parts.At(0)->GetSize()};
6768
size_t dataSize = parts.At(1)->GetSize();
6869
std::string messageData{static_cast<const char*>(parts.At(1)->GetData()), parts.At(1)->GetSize()};
69-
LOG(info) << "received message " << messageHeader << " of size " << dataSize << " # parts:" << parts.Size(); // << " Payload:" << messageData;
70+
nprint++;
71+
int nlimit = 60;
72+
int nrange = 8;
73+
if( nprint > nlimit && nprint < (nlimit + nrange + 1)) {
74+
LOG(info) << "received message " << messageHeader << " of size " << dataSize << " # parts:" << parts.Size(); // << " Payload:" << messageData;
75+
if(nprint == (nlimit + nrange) ) {
76+
nprint = 0;
77+
}
78+
}
7079
runMgr->processMessage(messageHeader, messageData);
7180
return true;
7281
};

Detectors/CTP/workflowScalers/src/ctpCCDBManager.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int ctpCCDBManager::saveRunScalersToCCDB(CTPRunScalers& scalers, long timeStart,
2828
{
2929
// data base
3030
if (mCCDBHost == "none") {
31-
LOG(info) << "Scalers not written to CCDB none";
31+
LOG(debug) << "Scalers not written to CCDB none";
3232
return 0;
3333
}
3434
// CTPActiveRun* run = mActiveRuns[i];
@@ -56,7 +56,7 @@ int ctpCCDBManager::saveRunScalersToQCDB(CTPRunScalers& scalers, long timeStart,
5656
{
5757
// data base
5858
if (mQCDBHost == "none") {
59-
LOG(info) << "Scalers not written to QCDB none";
59+
LOG(debug) << "Scalers not written to QCDB none";
6060
return 0;
6161
}
6262
// CTPActiveRun* run = mActiveRuns[i];q

0 commit comments

Comments
 (0)