martinzink commented on code in PR #1670:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1670#discussion_r1342622940
##########
libminifi/include/core/logging/Logger.h:
##########
@@ -112,19 +62,42 @@ enum LOG_LEVEL {
off = 6
};
+inline spdlog::level::level_enum mapToSpdLogLevel(LOG_LEVEL level) {
+ switch (level) {
+ case trace: return spdlog::level::trace;
+ case debug: return spdlog::level::debug;
+ case info: return spdlog::level::info;
+ case warn: return spdlog::level::warn;
+ case err: return spdlog::level::err;
+ case critical: return spdlog::level::critical;
+ case off: return spdlog::level::off;
+ }
+ throw std::invalid_argument(fmt::format("Invalid LOG_LEVEL {}",
magic_enum::enum_underlying(level)));
+}
+
+inline LOG_LEVEL mapFromSpdLogLevel(spdlog::level::level_enum level) {
+ switch (level) {
+ case spdlog::level::trace: return LOG_LEVEL::trace;
+ case spdlog::level::debug: return LOG_LEVEL::debug;
+ case spdlog::level::info: return LOG_LEVEL::info;
+ case spdlog::level::warn: return LOG_LEVEL::warn;
+ case spdlog::level::err: return LOG_LEVEL::err;
+ case spdlog::level::critical: return LOG_LEVEL::critical;
Review Comment:
I think it might be advantageous to keep critical, I think we should start
logging critical for errors that are preventing minifi to start up or
configuration errors that prevent minifi to start the flow. And keep errors to
situations where they only affect part of the functionality (e.g. processor
errors)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]