phrocker commented on a change in pull request #596: MINIFICPP-925 - Fix
TailFile hang on long lines
URL: https://github.com/apache/nifi-minifi-cpp/pull/596#discussion_r296881218
##########
File path: extensions/standard-processors/processors/LogAttribute.cpp
##########
@@ -137,33 +137,32 @@ void LogAttribute::onTrigger(const
std::shared_ptr<core::ProcessContext> &contex
message << "\n" << "Payload:" << "\n";
ReadCallback callback(flow->getSize());
session->read(flow, &callback);
- for (unsigned int i = 0, j = 0; i < callback.read_size_; i++) {
- message << std::hex << callback.buffer_[i];
- j++;
- if (j == 80) {
- message << '\n';
- j = 0;
- }
+
+ auto payload_hex = utils::StringUtils::to_hex(callback.buffer_.data(),
callback.buffer_.size());
+ for (size_t i = 0; i < payload_hex.size(); i += 80) {
Review comment:
Sorry I was referring to both interpretations -- but misread the conditional
in full view about the max size of the FF and thought it would only log the
first MB, but it looks like it only logs flow files < 1 MB -- which while not
clear from the options is at least a sensical line in the sand.
----------------------------------------------------------------
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