data hexdump in warning

This commit is contained in:
Alex 2020-11-20 23:37:34 +01:00
parent f9be964c3f
commit a8b3c8fd58
3 changed files with 43 additions and 0 deletions

39
Cargo.lock generated
View file

@ -15,6 +15,16 @@ version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
[[package]]
name = "arrayvec"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06f59fe10306bb78facd90d28c2038ad23ffaaefa85bac43c8a434cde383334f"
dependencies = [
"nodrop",
"odds",
]
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.36" version = "0.1.36"
@ -588,6 +598,7 @@ dependencies = [
"garage_rpc 0.1.0", "garage_rpc 0.1.0",
"garage_util 0.1.0", "garage_util 0.1.0",
"hex", "hex",
"hexdump",
"log", "log",
"rand", "rand",
"rmp-serde", "rmp-serde",
@ -743,6 +754,16 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
[[package]]
name = "hexdump"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "850f3f2c33d20c0f96c4485e087dd580ff041d720988ebf4c84a42acf739262b"
dependencies = [
"arrayvec",
"itertools",
]
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.7.1" version = "0.7.1"
@ -870,6 +891,12 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "itertools"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f"
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "0.4.6" version = "0.4.6"
@ -1027,6 +1054,12 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "nodrop"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
[[package]] [[package]]
name = "num-integer" name = "num-integer"
version = "0.1.43" version = "0.1.43"
@ -1056,6 +1089,12 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "odds"
version = "0.2.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eae0151b9dacf24fcc170d9995e511669a082856a91f958a2fe380bfab3fb22"
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.4.0" version = "1.4.0"

View file

@ -21,6 +21,7 @@ rand = "0.7"
hex = "0.3" hex = "0.3"
arc-swap = "0.4" arc-swap = "0.4"
log = "0.4" log = "0.4"
hexdump = "0.1"
sled = "0.31" sled = "0.31"

View file

@ -464,6 +464,9 @@ where
Some(x) => Ok(x), Some(x) => Ok(x),
None => { None => {
warn!("Unable to decode entry of {}: {}", self.name, e); warn!("Unable to decode entry of {}: {}", self.name, e);
for line in hexdump::hexdump_iter(bytes) {
debug!("{}", line);
}
Err(e.into()) Err(e.into())
} }
}, },