Skip to content

Commit

Permalink
262 audit pdm 011 logging in runtime (#345)
Browse files Browse the repository at this point in the history
* change warn to trace

* change warn to trace
  • Loading branch information
b-yap authored Nov 13, 2023
1 parent 9e59729 commit 3ed89bd
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use codec::Encode;
use cumulus_client_cli::generate_genesis_block;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::{info, warn};
use log::{info, trace};
use runtime_common::opaque::Block;
use sc_chain_spec::GenericChainSpec;
use sc_cli::{
Expand Down Expand Up @@ -452,7 +452,7 @@ pub fn run() -> Result<()> {
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });

if !collator_options.relay_chain_rpc_urls.is_empty() && cli.relay_chain_args.len() > 0 {
warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options.");
trace!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options.");
}

let res = match config.chain_spec.identify() {
Expand Down
2 changes: 1 addition & 1 deletion runtime/amplitude/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
{
log::warn!(
log::trace!(
target: "xcm::barriers",
"Unexpected ReserveAssetDeposited from the relay chain",
);
Expand Down
2 changes: 1 addition & 1 deletion runtime/development/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
{
log::warn!(
log::trace!(
target: "xcm::barriers",
"Unexpected ReserveAssetDeposited from the relay chain",
);
Expand Down
18 changes: 9 additions & 9 deletions runtime/foucoco/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ use orml_currencies_allowance_extension::{
};

use frame_support::{
log::{error, warn},
log::{error, trace},
pallet_prelude::*,
traits::InstanceFilter,
};
Expand Down Expand Up @@ -979,7 +979,7 @@ where
{
let func_id = env.func_id();

warn!("Calling function with ID {} from Psp22Extension", func_id);
trace!("Calling function with ID {} from Psp22Extension", func_id);

// debug_message weight is a good approximation of the additional overhead of going
// from contract layer to substrate layer.
Expand All @@ -1001,7 +1001,7 @@ where
let currency_id: CurrencyId = chain_ext::decode(input)
.map_err(|_| DispatchError::Other("ChainExtension failed to decode input"))?;

warn!("Calling totalSupply() for currency {:?}", currency_id);
trace!("Calling totalSupply() for currency {:?}", currency_id);

ensure!(
orml_currencies_allowance_extension::Pallet::<T>::is_allowed_currency(
Expand Down Expand Up @@ -1030,7 +1030,7 @@ where
DispatchError::Other("ChainExtension failed to decode input")
})?;

warn!(
trace!(
"Calling balanceOf() for currency {:?} and account {:?}",
currency_id, account_id
);
Expand Down Expand Up @@ -1069,7 +1069,7 @@ where
) = chain_ext::decode(input)
.map_err(|_| DispatchError::Other("ChainExtension failed to decode input"))?;

warn!(
trace!(
"Calling transfer() sending {:?} {:?}, from {:?} to {:?}",
amount, currency_id, caller, recipient
);
Expand Down Expand Up @@ -1099,7 +1099,7 @@ where
DispatchError::Other("ChainExtension failed to decode input")
})?;

warn!(
trace!(
"Calling allowance() for currency {:?}, owner {:?} and spender {:?}",
currency_id, owner, spender
);
Expand Down Expand Up @@ -1137,7 +1137,7 @@ where
) = chain_ext::decode(input)
.map_err(|_| DispatchError::Other("ChainExtension failed to decode input"))?;

warn!(
trace!(
"Calling approve() allowing spender {:?} to transfer {:?} {:?} from {:?}",
spender, amount, currency_id, caller
);
Expand Down Expand Up @@ -1174,7 +1174,7 @@ where
) = chain_ext::decode(input)
.map_err(|_| DispatchError::Other("ChainExtension failed to decode input"))?;

warn!(
trace!(
"Calling transfer_from() for caller {:?}, sending {:?} {:?}, from {:?} to {:?}",
caller, amount, currency_id, owner, recipient
);
Expand Down Expand Up @@ -1207,7 +1207,7 @@ where
symbol.to_trimmed_vec(),
);

warn!("Calling get_coin_info() for: {:?}:{:?}", blockchain, symbol);
trace!("Calling get_coin_info() for: {:?}:{:?}", blockchain, symbol);

let result = match result {
Ok(coin_info) =>
Expand Down
2 changes: 1 addition & 1 deletion runtime/foucoco/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
{
log::warn!(
log::trace!(
target: "xcm::barriers",
"Unexpected ReserveAssetDeposited from the relay chain",
);
Expand Down
2 changes: 1 addition & 1 deletion runtime/integration-tests/src/sibling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
{
log::warn!(
log::trace!(
target: "xcm::barriers",
"Unexpected ReserveAssetDeposited from the relay chain",
);
Expand Down
2 changes: 1 addition & 1 deletion runtime/pendulum/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
instructions.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
{
log::warn!(
log::trace!(
target: "xcm::barriers",
"Unexpected ReserveAssetDeposited from the relay chain",
);
Expand Down

0 comments on commit 3ed89bd

Please sign in to comment.