Skip to content

Commit

Permalink
style: update log message levels for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
S0c5 committed Aug 19, 2024
1 parent e75fc24 commit b335ea5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions sube/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ impl<'a> SubeBuilder<'a, (), ()> {
let block = url
.query_pairs()
.find(|(k, _)| k == "at")
.map(|(_, v)| {
log::info!("hello world{:?}", v);
v.parse::<u32>().expect("at to be a number")
});
.map(|(_, v)| v.parse::<u32>().expect("at query params must be a number"));

let path = url.path();

Expand Down
5 changes: 1 addition & 4 deletions sube/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ async fn query<'m>(
path: &str,
block: Option<u32>,
) -> Result<Response<'m>> {
log::info!("path {}", path);
let (pallet, item_or_call, mut keys) = parse_uri(path).ok_or(Error::BadInput)?;
log::info!("pallet {}", pallet);
let pallet = meta
.pallet_by_name(&pallet)
.ok_or_else(|| Error::PalletNotFound(pallet))?;
Expand Down Expand Up @@ -214,11 +212,9 @@ where

match response {
Response::Value(value) => {
log::info!("{:?}", serde_json::to_string(&value));
let str = serde_json::to_string(&value).expect("wrong account info");
let account_info: AccountInfo =
serde_json::from_str(&str).expect("it must serialize");
log::info!("{}", &account_info.nonce);
Ok(account_info.nonce)
}
_ => Err(Error::AccountNotFound),
Expand Down Expand Up @@ -392,6 +388,7 @@ pub trait Backend {

async fn get_storage_item(&self, key: RawKey, block: Option<u32>) -> crate::Result<RawValue> {
let res = self.get_storage_items(vec![key], block).await?;

res.into_iter()
.next()
.map(|(_, v)| v)
Expand Down
2 changes: 1 addition & 1 deletion sube/src/meta_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub trait EntryTy {
.into_iter()
.enumerate()
.map(|(i, type_id)| {
log::info!("type_call_ids.i={} type_call_ids.type_id={}", i, type_id);
log::trace!("type_call_ids.i={} type_call_ids.type_id={}", i, type_id);
let k = map_keys.get(i);
let hasher = hashers.get(i).expect("hasher not found");

Expand Down

0 comments on commit b335ea5

Please sign in to comment.