mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
devtools/decode-iolog: tool to decode hexstrings from io logging.
Slow, but useful. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
695bec531c
commit
0c189fe3a7
20
devtools/decode-iolog
Executable file
20
devtools/decode-iolog
Executable file
@ -0,0 +1,20 @@
|
||||
#! /bin/sh
|
||||
# Feed log in stdin (sometimes 'grep' to get interesting parts)
|
||||
|
||||
print_hex()
|
||||
{
|
||||
hex="$1"
|
||||
# We allow one character of trailing junk
|
||||
while [ ${#hex} -gt 1 ]; do
|
||||
/usr/bin/printf \\x$(echo "$hex" | cut -c1,2)
|
||||
hex=$(echo "$hex" | cut -c3-)
|
||||
done
|
||||
}
|
||||
|
||||
while read TIMESTAMP LOGDIR HEX; do
|
||||
case "$LOGDIR" in
|
||||
*\[IN\]|*\[OUT\])
|
||||
echo $LOGDIR:$(print_hex "$HEX")
|
||||
;;
|
||||
esac
|
||||
done
|
Loading…
Reference in New Issue
Block a user