Skip to content

Commit 890abee

Browse files
committed
log levels updated
1 parent 3329180 commit 890abee

File tree

12 files changed

+38
-35
lines changed

12 files changed

+38
-35
lines changed

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ This file describes the main feature changes for released versions of ReadoutCar
1212

1313
## v0.39.1 - 16/11/2022
1414
- Fixed CRORC start-stop-start: fifo ready counters reset, emptying last page if unused, flush order on stop, release of unused pages in internal fifo.
15+
16+
## next
17+
- log messages level updated: moved all Ops messages to Devel. The calling layer is in charge to reporting high level operation messages.

src/BarInterfaceBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class BarInterfaceBase : public BarInterface
129129
std::shared_ptr<Pda::PdaBar> mPdaBar;
130130

131131
/// Convenience function for InfoLogger
132-
void log(const std::string& logMessage, ILMessageOption = LogInfoOps);
132+
void log(const std::string& logMessage, ILMessageOption = LogInfoDevel);
133133

134134
private:
135135
/// Inheriting classes must implement this to check whether a given read is safe.

src/CommandLineUtilities/ProgramCleanup.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ProgramCleanup : public Program
8282
return {};
8383
};
8484

85-
Logger::get() << "`roc-cleanup` execution initiated by " << getUsername() << LogDebugOps_(4700) << endm;
85+
Logger::get() << "`roc-cleanup` execution initiated by " << getUsername() << LogDebugDevel_(4700) << endm;
8686

8787
// Take and hold DMA locks during cleanup
8888
std::vector<std::unique_ptr<Interprocess::Lock>> dmaLocks;
@@ -127,7 +127,7 @@ class ProgramCleanup : public Program
127127
sysCheckRet("modprobe uio_pci_dma");
128128
}
129129

130-
Logger::get() << "`roc-cleanup` execution finished" << LogDebugOps_(4710) << endm;
130+
Logger::get() << "`roc-cleanup` execution finished" << LogDebugDevel_(4710) << endm;
131131
return;
132132
}
133133

src/CommandLineUtilities/ProgramConfig.cxx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class ProgramConfig : public Program
395395
std::stringstream ss;
396396
ss << report;
397397
while (std::getline(ss, line)) {
398-
theLog << LogInfoSupport_(4805) << line << InfoLogger::endm;
398+
theLog << LogInfoDevel_(4805) << line << InfoLogger::endm;
399399
}
400400
} else {
401401
FILE* fp = fopen(fileName.c_str(), fileMode);
@@ -419,10 +419,10 @@ class ProgramConfig : public Program
419419

420420
// Configure all cards found - Normally used during boot
421421
if (mOptions.configAll) {
422-
Logger::get() << "Running RoC Configuration for all cards" << LogInfoOps_(4600) << endm;
422+
Logger::get() << "Running RoC Configuration for all cards" << LogInfoDevel_(4600) << endm;
423423
std::vector<CardDescriptor> cardsFound;
424424
if (mOptions.configUri == "") {
425-
Logger::get() << "A configuration URI is necessary with the startup-config flag set" << LogErrorOps_(4600) << endm;
425+
Logger::get() << "A configuration URI is necessary with the startup-config flag set" << LogErrorDevel_(4600) << endm;
426426
return;
427427
}
428428

@@ -436,9 +436,9 @@ class ProgramConfig : public Program
436436
CardConfigurator(card.pciAddress, mOptions.configUri, mOptions.forceConfig);
437437
reportStatus(card.pciAddress);
438438
} catch (const std::runtime_error& e) {
439-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
439+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
440440
} catch (const Exception& e) {
441-
Logger::get() << boost::diagnostic_information(e) << LogErrorOps_(4600) << endm;
441+
Logger::get() << boost::diagnostic_information(e) << LogErrorDevel_(4600) << endm;
442442
}
443443
}
444444
}
@@ -451,7 +451,7 @@ class ProgramConfig : public Program
451451
try {
452452
FirmwareChecker().checkFirmwareCompatibility(cardId);
453453
} catch (const Exception& e) {
454-
Logger::get() << boost::diagnostic_information(e) << LogErrorOps_(4600) << endm;
454+
Logger::get() << boost::diagnostic_information(e) << LogErrorDevel_(4600) << endm;
455455
throw;
456456
}
457457
}
@@ -523,35 +523,35 @@ class ProgramConfig : public Program
523523
return;
524524
}
525525

526-
Logger::get() << "Configuring card " << cardId << " with command line arguments" << LogDebugOps_(4600) << endm;
526+
Logger::get() << "Configuring card " << cardId << " with command line arguments" << LogDebugDevel_(4600) << endm;
527527
if (mOptions.forceConfig) {
528-
Logger::get() << "`--force` enabled" << LogDebugOps_(4600) << endm;
528+
Logger::get() << "`--force` enabled" << LogDebugDevel_(4600) << endm;
529529
}
530530

531531
try {
532532
CardConfigurator(params, mOptions.forceConfig);
533533
reportStatus(cardId);
534534
} catch (const std::runtime_error& e) {
535-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
535+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
536536
throw;
537537
} catch (const Exception& e) {
538-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
538+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
539539
throw;
540540
}
541541
} else {
542-
Logger::get() << "Configuring card " << cardId << " with config uri: " << mOptions.configUri << LogDebugOps_(4600) << endm;
542+
Logger::get() << "Configuring card " << cardId << " with config uri: " << mOptions.configUri << LogDebugDevel_(4600) << endm;
543543
if (mOptions.forceConfig) {
544-
Logger::get() << "`--force` enabled" << LogDebugOps_(4600) << endm;
544+
Logger::get() << "`--force` enabled" << LogDebugDevel_(4600) << endm;
545545
}
546546

547547
try {
548548
CardConfigurator(cardId, mOptions.configUri, mOptions.forceConfig);
549549
reportStatus(cardId);
550550
} catch (const std::runtime_error& e) {
551-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
551+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
552552
throw;
553553
} catch (const Exception& e) {
554-
Logger::get() << e.what() << LogErrorOps_(4600) << endm;
554+
Logger::get() << e.what() << LogErrorDevel_(4600) << endm;
555555
throw;
556556
}
557557
}

src/CommandLineUtilities/ProgramCtpEmulator.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ class ProgramCtpEmulator : public Program
8484

8585
CardType::type cardType = bar2->getCardType();
8686
if (cardType == CardType::type::Crorc) {
87-
Logger::get() << "CRORC not supported" << LogErrorOps_(4803) << endm;
87+
Logger::get() << "CRORC not supported" << LogErrorDevel_(4803) << endm;
8888
return;
8989
} else if (cardType != CardType::type::Cru) {
90-
Logger::get() << "Invalid card type" << LogErrorOps_(4804) << endm;
90+
Logger::get() << "Invalid card type" << LogErrorDevel_(4804) << endm;
9191
return;
9292
}
9393

src/CommandLineUtilities/ProgramLoopback.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class ProgramLoopback : public Program
9999
auto cardType = card.cardType;
100100

101101
if (cardType == CardType::type::Crorc) {
102-
Logger::get() << "CRORC not supported" << LogErrorOps << endm;
102+
Logger::get() << "CRORC not supported" << LogErrorDevel << endm;
103103
} else if (cardType == CardType::type::Cru) {
104104
if (mOptions.expertView) {
105105
formatHeader = " %-9s %-10s %-19s %-16s %-12s %-21s %-17s\n";

src/Crorc/CrorcBar.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ int CrorcBar::getEndpointNumber()
106106

107107
void CrorcBar::configure(bool /*force*/)
108108
{
109-
log("Configuring...", LogInfoOps_(4650));
109+
log("Configuring...", LogInfoDevel_(4650));
110110

111111
// enable laser
112112
log("Enabling the laser", LogInfoDevel_(4651));
@@ -127,7 +127,7 @@ void CrorcBar::configure(bool /*force*/)
127127
log("Configuring Time Frame detection", LogInfoDevel_(4655));
128128
setTimeFrameDetectionEnabled(mTimeFrameDetectionEnabled);
129129

130-
log("CRORC configuration done", LogInfoOps_(4656));
130+
log("CRORC configuration done", LogInfoDevel_(4656));
131131
}
132132

133133
Crorc::ReportInfo CrorcBar::report(bool forConfig)

src/Crorc/CrorcDmaChannel.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void CrorcDmaChannel::deviceStartDma()
133133
// needed to wait a bit FEE
134134
std::this_thread::sleep_for(100ms);
135135

136-
log("DMA started", LogInfoOps_(4303));
136+
log("DMA started", LogInfoDevel_(4303));
137137
}
138138

139139
void CrorcDmaChannel::deviceStopDma()

src/Cru/CruBar.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,12 +725,12 @@ void CruBar::configure(bool force)
725725
mGbtEnabled == reportInfo.gbtEnabled &&
726726
mTimeFrameLength == reportInfo.timeFrameLength &&
727727
!force) {
728-
log("No need to reconfigure further", LogInfoOps_(4600));
728+
log("No need to reconfigure further", LogInfoDevel_(4600));
729729
return;
730730
}
731731

732732
checkConfigParameters();
733-
log("Reconfiguring", LogInfoOps_(4600));
733+
log("Reconfiguring", LogInfoDevel_(4600));
734734

735735
Ttc ttc = Ttc(mPdaBar, mSerial);
736736
DatapathWrapper datapathWrapper = DatapathWrapper(mPdaBar);
@@ -855,7 +855,7 @@ void CruBar::configure(bool force)
855855
setTimeFrameLength(mTimeFrameLength);
856856
}
857857

858-
log("CRU configuration done", LogInfoOps_(4600));
858+
log("CRU configuration done", LogInfoDevel_(4600));
859859
}
860860

861861
/// Sets the mWrapperCount variable

src/Cru/CruDmaChannel.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ CruDmaChannel::CruDmaChannel(const Parameters& parameters)
9696
mLinks.push_back(newLink);
9797
}
9898

99-
log(stream.str(), LogInfoOps_(4252));
99+
log(stream.str(), LogInfoDevel_(4252));
100100

101101
if (mLinks.empty()) {
102102
BOOST_THROW_EXCEPTION(Exception() << ErrorInfo::Message("No links are enabled. Check with roc-status. Configure with roc-config."));

0 commit comments

Comments
 (0)