martinzink commented on a change in pull request #1081:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1081#discussion_r640448605



##########
File path: extensions/pdh/PerformanceDataMonitor.cpp
##########
@@ -264,16 +281,29 @@ void 
PerformanceDataMonitor::setupMembersFromProperties(const std::shared_ptr<co
 
   std::string output_format_string;
   if (context->getProperty(OutputFormatProperty.getName(), 
output_format_string)) {
-    if (output_format_string == OPEN_TELEMETRY_FORMAT_STR) {
-      logger_->log_trace("OutputFormat is configured to be OpenTelemetry");
+    if (output_format_string == PRETTY_OPEN_TELEMETRY_FORMAT_STR || 
output_format_string == COMPACT_OPEN_TELEMETRY_FORMAT_STR) {
       output_format_ = OutputFormat::OPENTELEMETRY;
-    } else if (output_format_string == JSON_FORMAT_STR) {
-      logger_->log_trace("OutputFormat is configured to be JSON");
+      pretty_output_ = output_format_string == 
PRETTY_OPEN_TELEMETRY_FORMAT_STR;
+      logger_->log_trace("OutputFormat is configured to be %s OpenTelemetry", 
pretty_output_ ? "pretty" : "compact");
+    } else if (output_format_string == PRETTY_JSON_FORMAT_STR || 
output_format_string == COMPACT_JSON_FORMAT_STR) {
       output_format_ = OutputFormat::JSON;
+      pretty_output_ = output_format_string == PRETTY_JSON_FORMAT_STR;
+      logger_->log_trace("OutputFormat is configured to be %s JSON", 
pretty_output_ ? "pretty" : "compact");
     } else {
-      logger_->log_error("Invalid OutputFormat, defaulting to JSON");
       output_format_ = OutputFormat::JSON;
+      pretty_output_ = true;
+      logger_->log_error("Invalid OutputFormat, defaulting to %s JSON", 
pretty_output_ ? "pretty" : "compact");

Review comment:
       changed it in 
[0844651](https://github.com/martinzink/nifi-minifi-cpp/commit/084465104f3b63c29485638adb1c62d2b3b7e0eb)




-- 
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:
us...@infra.apache.org


Reply via email to