bakaid commented on a change in pull request #709: MINIFICPP-1088 - clean up 
minifiexe and MINIFI_HOME logic
URL: https://github.com/apache/nifi-minifi-cpp/pull/709#discussion_r367513648
 
 

 ##########
 File path: libminifi/test/TestBase.cpp
 ##########
 @@ -18,6 +18,21 @@
 
 #include "./TestBase.h"
 
+#include "spdlog/spdlog.h"
+
+void LogTestController::setLevel(const std::string name, 
spdlog::level::level_enum level) {
+  logger_->log_info("Setting log level for %s to %s", name, 
spdlog::level::to_str(level));
+  std::string adjusted_name = name;
+  const std::string clazz = "class ";
+  auto haz_clazz = name.find(clazz);
+  if (haz_clazz == 0)
+    adjusted_name = name.substr(clazz.length(), name.length() - 
clazz.length());
+  if (config && config->shortenClassNames()) {
+    utils::ClassUtils::shortenClassName(adjusted_name, adjusted_name);
+  }
 
 Review comment:
   This has just been moved from the h to the cpp file to avoid some include 
issues. You are welcome to create a refactor task for this, if it is used in 
more places I would agree that a good solution.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to