From 816f758e67d759f8b4d16146be686f9f429d00d1 Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:44:55 +0530 Subject: [PATCH] chore: move print macros to span for logging later --- src/v2/api.rs | 2 +- src/v2/mutation.rs | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/v2/api.rs b/src/v2/api.rs index e4138fe..a7fe39f 100644 --- a/src/v2/api.rs +++ b/src/v2/api.rs @@ -53,7 +53,7 @@ pub(crate) async fn get_snippet( let langfn = get_lang(lang)?; - println!("{prompt:?}"); + // span!(Level::INFO, "received a prompt {prompt:?}"); let mut appstate = data.inner.lock().map_err(|_| Error::Busy)?; let target = appstate diff --git a/src/v2/mutation.rs b/src/v2/mutation.rs index 3830eaf..9bbc6b8 100644 --- a/src/v2/mutation.rs +++ b/src/v2/mutation.rs @@ -33,7 +33,9 @@ pub fn from_path>(path: P) -> Result { let node_name = node.name().value(); if node_name != "mutation" && node_name != "description" { - bail!("document root must only contain `mutation` or `description` nodes: got {node_name}"); + bail!( + "document root must only contain `mutation` or `description` nodes: got {node_name}" + ); } if node_name == "description" { @@ -97,7 +99,7 @@ pub fn apply( let mut query_result_map = HashMap::new(); for mutation in &mutations.mutations { let query_result = query(root_node, mutation.expression.as_str(), &lang, source_bytes); - eprintln!("{:?}", query_result); + // span!(Level::DEBUG, "{:?}", query_result); split_ats.push(query_result.start); split_ats.push(query_result.end); @@ -108,7 +110,7 @@ pub fn apply( Substitute::Capture(attrib) => &query_result.captures[attrib], }) } - eprintln!("{ast_rewrite:?}"); + // span!(Level::DEBUG, "{ast_rewrite:?}"); query_result_map.insert(query_result.start, ast_rewrite); } @@ -122,11 +124,6 @@ pub fn apply( Ok(output) } -fn display_s_expr(node: Node<'_>) { - let exp = node.to_sexp(); - eprintln!("{exp:?}"); -} - #[derive(Debug)] struct QueryCooked { captures: HashMap,