Skip to content

Commit e5f893f

Browse files
ehellbarktf
authored andcommitted
adding GPUCritical, putting InfoLoggerMessageOption initializer to log() call
1 parent 2729899 commit e5f893f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Framework/DataTakingSupport/src/Plugin.cxx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,13 @@ auto createInfoLoggerSinkHelper(InfoLogger* logger, InfoLoggerContext* ctx)
132132
return;
133133
}
134134

135-
InfoLogger::InfoLoggerMessageOption opt = {
136-
severity,
137-
level,
138-
InfoLogger::undefinedMessageOption.errorCode,
139-
metadata.file,
140-
atoi(std::string(metadata.line.data(), metadata.line.size()).c_str())};
141-
142135
if (logger) {
143-
logger->log(opt, *ctx, "%s", content.c_str());
136+
logger->log({severity,
137+
level,
138+
InfoLogger::undefinedMessageOption.errorCode,
139+
std::string(metadata.file).c_str(),
140+
atoi(std::string(metadata.line).c_str())},
141+
*ctx, "%s", content.c_str());
144142
}
145143
};
146144
};

GPU/GPUTracking/Definitions/GPULogging.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define GPUWarning(...)
2525
#define GPUAlarm(...)
2626
#define GPUError(...)
27+
#define GPUCritical(...)
2728
#define GPUFatal(...)
2829
#elif defined(GPUCA_STANDALONE) && !defined(GPUCA_GPUCODE_DEVICE) && !defined(GPUCA_NO_FMT)
2930
#include <cstdio>
@@ -38,6 +39,7 @@
3839
fmt::fprintf(stderr, string "\n", ##__VA_ARGS__); \
3940
}
4041
#define GPUError(...) GPUWarning(__VA_ARGS__)
42+
#define GPUCritical(...) GPUWarning(__VA_ARGS__)
4143
#define GPUAlarm(...) GPUWarning(__VA_ARGS__)
4244
#define GPUFatal(string, ...) \
4345
{ \
@@ -64,6 +66,7 @@
6466
}
6567
#define GPUAlarm(...) GPUWarning(__VA_ARGS__)
6668
#define GPUError(...) GPUWarning(__VA_ARGS__)
69+
#define GPUCritical(...) GPUWarning(__VA_ARGS__)
6770
#define GPUFatal(string, ...) \
6871
{ \
6972
fprintf(stderr, string "\n", __VA_ARGS__); \
@@ -78,6 +81,7 @@
7881
#define GPUWarning(...) LOGF(warning, __VA_ARGS__)
7982
#define GPUAlarm(...) LOGF(alarm, __VA_ARGS__)
8083
#define GPUError(...) LOGF(error, __VA_ARGS__)
84+
#define GPUCritical(...) LOGF(critical, __VA_ARGS__)
8185
#define GPUFatal(...) LOGF(fatal, __VA_ARGS__)
8286
#endif
8387

0 commit comments

Comments
 (0)