mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 16:11:05 +00:00
Init RuntimeLogger automatically for each runtime api call (#8128)
* Init `RuntimeLogger` automatically for each runtime api call This pr change the runtime api in such a way to always and automatically enable the `RuntimeLogger`. This enables the user to use `log` or `tracing` from inside the runtime to create log messages. As logging introduces some extra code and especially increases the size of the wasm blob. It is advised to disable all logging completely with `sp-api/disable-logging` when doing the wasm builds for the on-chain wasm runtime. Besides these changes, the pr also brings most of the logging found in frame to the same format "runtime::*". * Update frame/im-online/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Update test-utils/runtime/Cargo.toml * Fix test * Don't use tracing in the runtime, as we don't support it :D * Fixes Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -27,9 +27,7 @@ mod tests;
|
||||
|
||||
use sp_std::vec::Vec;
|
||||
use frame_support::{
|
||||
decl_module, decl_event, decl_storage, Parameter, debug,
|
||||
traits::Get,
|
||||
weights::Weight,
|
||||
decl_module, decl_event, decl_storage, Parameter, traits::Get, weights::Weight,
|
||||
};
|
||||
use sp_runtime::{traits::{Hash, Zero}, Perbill};
|
||||
use sp_staking::{
|
||||
@@ -141,9 +139,10 @@ decl_module! {
|
||||
false
|
||||
},
|
||||
Err(_) => {
|
||||
debug::native::error!(
|
||||
target: "pallet-offences",
|
||||
"re-submitting a deferred slash returned Err at {}. This should not happen with pallet-staking",
|
||||
log::error!(
|
||||
target: "runtime::offences",
|
||||
"re-submitting a deferred slash returned Err at {:?}. \
|
||||
This should not happen with pallet-staking",
|
||||
now,
|
||||
);
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user