mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 06:57:58 +00:00
frame-support: Use logging for printing corrupted state (#10612)
`runtime_print!` is printed by default using `debug`, aka not being visible. With `log::error!` it will be printed directly to the user. Production networks like Polkadot disable logging, but for them we run special nodes that have logging enabled.
This commit is contained in:
@@ -34,8 +34,9 @@ pub fn get<T: Decode + Sized>(child_info: &ChildInfo, key: &[u8]) -> Option<T> {
|
||||
sp_io::default_child_storage::get(storage_key, key).and_then(|v| {
|
||||
Decode::decode(&mut &v[..]).map(Some).unwrap_or_else(|_| {
|
||||
// TODO #3700: error should be handleable.
|
||||
crate::runtime_print!(
|
||||
"ERROR: Corrupted state in child trie at {:?}/{:?}",
|
||||
log::error!(
|
||||
target: "runtime::storage",
|
||||
"Corrupted state in child trie at {:?}/{:?}",
|
||||
storage_key,
|
||||
key,
|
||||
);
|
||||
|
||||
@@ -25,7 +25,11 @@ pub fn get<T: Decode + Sized>(key: &[u8]) -> Option<T> {
|
||||
sp_io::storage::get(key).and_then(|val| {
|
||||
Decode::decode(&mut &val[..]).map(Some).unwrap_or_else(|_| {
|
||||
// TODO #3700: error should be handleable.
|
||||
crate::runtime_print!("ERROR: Corrupted state at {:?}", key);
|
||||
log::error!(
|
||||
target: "runtime::storage",
|
||||
"Corrupted state at {:?}",
|
||||
key,
|
||||
);
|
||||
None
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user