-
Notifications
You must be signed in to change notification settings - Fork 56
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
Conversation
1929935
to
3f02596
Compare
...tor/command-log/src/main/java/io/aklivity/zilla/runtime/command/log/internal/LogCommand.java
Outdated
Show resolved
Hide resolved
...mand-log/src/main/java/io/aklivity/zilla/runtime/command/log/internal/LogStreamsCommand.java
Outdated
Show resolved
Hide resolved
...mand-log/src/main/java/io/aklivity/zilla/runtime/command/log/internal/LogStreamsCommand.java
Outdated
Show resolved
Hide resolved
...command-log/src/main/java/io/aklivity/zilla/runtime/command/log/internal/LoggableStream.java
Outdated
Show resolved
Hide resolved
...command-log/src/main/java/io/aklivity/zilla/runtime/command/log/internal/LoggableStream.java
Outdated
Show resolved
Hide resolved
...command-log/src/main/java/io/aklivity/zilla/runtime/command/log/internal/LoggableStream.java
Outdated
Show resolved
Hide resolved
...command-log/src/main/java/io/aklivity/zilla/runtime/command/log/internal/LoggableStream.java
Outdated
Show resolved
Hide resolved
hexData.append(String.format("%02x", payload.buffer().getByte(payload.offset() + i))); | ||
hexData.append(i < data.length() - 1 ? ':' : ""); | ||
} | ||
out.printf(verboseFormat, index, offset, timestamp, hexData); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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[]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, pls chk
Description
Create a command line switch
-p
or--payload
to include the payload of theDATA
frames as a hex string in the output of thelog
command.Fixes # (issue)