Skip to content
Snippets Groups Projects
Verified Commit 6d5f45f3 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add more debug output

parent c197d506
No related branches found
No related tags found
No related merge requests found
......@@ -154,11 +154,17 @@ fn get_data(conf: &Config, prefix: &str, endpoint: &str, param: String, token: &
pub fn get_data_jq<T: for<'de> Deserialize<'de>>(conf: &Config, prefix: &str, endpoint: &str, param: String, token: &BasicTokenResponse, multi: bool) -> Result<T, Box<dyn error::Error>> {
let res: Option<String> = get_optional(&conf, &full_key(vec![prefix, "maps", endpoint]));
let jq_code = match res {
Some(s) => match multi {
true => "map(".to_string() + &s + ")",
false => s
Some(s) => {
debug!("Found jq mapping program for endpoint {}", endpoint);
match multi {
true => "map(".to_string() + &s + ")",
false => s
}
},
None => ".".to_string()
None => {
debug!("No jq mapping program for endpoint {}; using default (no-op)", endpoint);
".".to_string()
}
};
let mut jq_prog = jq_rs::compile(&jq_code)?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment