Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include data payload as hex in the output of log command #523

Merged
merged 3 commits into from
Nov 27, 2023

Conversation

attilakreiner
Copy link
Contributor

@attilakreiner attilakreiner commented Oct 19, 2023

Description

Create a command line switch -p or --payload to include the payload of the DATA frames as a hex string in the output of the log command.

Fixes # (issue)

@attilakreiner attilakreiner marked this pull request as ready for review October 19, 2023 16:02
hexData.append(String.format("%02x", payload.buffer().getByte(payload.offset() + i)));
hexData.append(i < data.length() - 1 ? ':' : "");
}
out.printf(verboseFormat, index, offset, timestamp, hexData);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at using BitUtil.toHex(...) with a shared temporary byte array instead of string builder append.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use payload.buffer.getBytes(...) to populate the byte[].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, pls chk

@jfallows jfallows merged commit 94a3362 into aklivity:develop Nov 27, 2023
@attilakreiner attilakreiner deleted the command-log-payload branch November 27, 2023 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants