Skip to content

Commit

Permalink
refactor: improve the log information
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Sopena Ballesteros committed May 23, 2024
1 parent b14a4ac commit fb366e7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/bos/session/shasta/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ pub mod v2 {
shasta_root_cert: &[u8],
id_opt: Option<&str>,
) -> Result<Vec<BosSession>, Error> {
log::info!("Get BOS sessions '{}'", id_opt.unwrap_or("all available"));

let client;

let client_builder = reqwest::Client::builder()
Expand Down
5 changes: 4 additions & 1 deletion src/bos/template/shasta/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ pub mod v1 {
shasta_root_cert: &[u8],
bos_session_template_id_opt: Option<&String>,
) -> Result<Vec<BosSessionTemplate>, reqwest::Error> {
log::info!("Get BOS sessiontemplte {:?}", bos_session_template_id_opt);
log::info!(
"Get BOS sessiontemplates '{}'",
bos_session_template_id_opt.unwrap_or(&"all available".to_string())
);

let client_builder = reqwest::Client::builder()
.add_root_certificate(reqwest::Certificate::from_pem(shasta_root_cert)?);
Expand Down
5 changes: 5 additions & 0 deletions src/cfs/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ pub mod shasta {
session_name_opt: Option<&String>,
is_succeded_opt: Option<bool>,
) -> Result<Vec<CfsSessionGetResponse>, Error> {
log::info!(
"Get CFS sessions '{}'",
session_name_opt.unwrap_or(&"all available".to_string())
);

let client_builder = reqwest::Client::builder()
.add_root_certificate(reqwest::Certificate::from_pem(shasta_root_cert)?);

Expand Down
5 changes: 5 additions & 0 deletions src/ims/image/mesa/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ pub async fn get(
shasta_root_cert: &[u8],
image_id_opt: Option<&str>,
) -> Result<Vec<Image>, reqwest::Error> {
log::info!(
"Get IMS images '{}'",
image_id_opt.unwrap_or("all available")
);

let response_rslt = crate::ims::image::shasta::http_client::get_raw(
shasta_token,
shasta_base_url,
Expand Down
6 changes: 5 additions & 1 deletion src/ims/image/shasta/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ pub async fn get_raw(
shasta_root_cert: &[u8],
image_id_opt: Option<&str>,
) -> Result<reqwest::Response, reqwest::Error> {
log::info!("Fetching images - id: {:?}", image_id_opt);
log::info!(
"Get IMS images '{}'",
image_id_opt.unwrap_or("all available")
);

let client_builder = reqwest::Client::builder()
.add_root_certificate(reqwest::Certificate::from_pem(shasta_root_cert)?);

Expand Down

0 comments on commit fb366e7

Please sign in to comment.