Skip to content

Commit 440ee49

Browse files
committed
commit to synchronize
1 parent 0fb7a09 commit 440ee49

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

Detectors/CTF/workflow/src/CTFReaderSpec.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ void CTFReaderSpec::run(ProcessingContext& pc)
200200
bool waitAcknowledged = false;
201201
long startWait = 0;
202202

203+
fprintf(stderr, "Warning in <CTFReaderSpec>: this is a test warning message.\n");
204+
fprintf(stderr, "SysError in <CTFReaderSpec>: this is a test warning message.\n");
205+
fprintf(stderr, "Print in <CTFReaderSpec>: this is a test warning message.\n");
206+
fprintf(stderr, "Fatal in <CTFReaderSpec>: this is a test warning message.\n");
207+
fprintf(stderr, "*** Break ***\n");
208+
203209
while (mRunning) {
204210
if (mCTFTree) { // there is a tree open with multiple CTF
205211
if (mInput.ctfIDs.empty() || mInput.ctfIDs[mSelIDEntry] == mCTFCounter) { // no selection requested or matching CTF ID is found

Framework/Core/include/Framework/LogParsingHelpers.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef O2_FRAMEWORK_LOGPARSINGHELPERS_H_
1212
#define O2_FRAMEWORK_LOGPARSINGHELPERS_H_
1313

14+
#include <map>
1415
#include <string>
1516
#include <string_view>
1617

@@ -34,6 +35,9 @@ struct LogParsingHelpers {
3435
/// Available log levels
3536
static char const* const LOG_LEVELS[(int)LogLevel::Size];
3637

38+
/// Map from ROOT log string to log level
39+
static const std::map<std::string, LogLevel> MAP_ROOT_LOG_LEVELS;
40+
3741
/// Extract the log style from a log string @param s
3842
/// Token style can then be used for colouring the logs
3943
/// in the GUI or to exit with error if a sufficient

Framework/Core/src/LogParsingHelpers.cxx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ char const* const LogParsingHelpers::LOG_LEVELS[(int)LogParsingHelpers::LogLevel
2424
"UNKNOWN"};
2525
using LogLevel = o2::framework::LogParsingHelpers::LogLevel;
2626

27+
const std::map<std::string, LogLevel> LogParsingHelpers::MAP_ROOT_LOG_LEVELS = {
28+
{"Print in <", LogLevel::Info},
29+
{"Info in <", LogLevel::Info},
30+
{"Warning in <", LogLevel::Warning},
31+
{"Error in <", LogLevel::Error},
32+
{"SysError in <", LogLevel::Error},
33+
{"Fatal in <", LogLevel::Fatal},
34+
{"*** Break ***", LogLevel::Fatal}};
35+
2736
LogLevel LogParsingHelpers::parseTokenLevel(std::string_view const s)
2837
{
2938

@@ -41,6 +50,11 @@ LogLevel LogParsingHelpers::parseTokenLevel(std::string_view const s)
4150
(unsigned char)s[1] - '0' > 9 || (unsigned char)s[2] - '0' > 9 ||
4251
(unsigned char)s[4] - '0' > 9 || (unsigned char)s[5] - '0' > 9 ||
4352
(unsigned char)s[7] - '0' > 9 || (unsigned char)s[8] - '0' > 9) {
53+
for (const auto& level : LogParsingHelpers::MAP_ROOT_LOG_LEVELS) {
54+
if (s.starts_with(level.first)) {
55+
return level.second;
56+
}
57+
}
4458
return LogLevel::Unknown;
4559
}
4660

Framework/Core/src/runDataProcessing.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,9 @@ void processChildrenOutput(uv_loop_t* loop,
891891
info.history[info.historyPos] = token;
892892
info.historyLevel[info.historyPos] = logLevel;
893893
info.historyPos = (info.historyPos + 1) % info.history.size();
894-
fmt::print("[{}:{}]: {}\n", info.pid, spec.id, token);
894+
fmt::print("{}", (int)control.logLevel);
895+
fmt::print("{}", control.logFilter);
896+
fmt::print("{} [{}:{}]: {}\n", (int)logLevel, info.pid, spec.id, token);
895897
}
896898
// We keep track of the maximum log error a
897899
// device has seen.

0 commit comments

Comments
 (0)