Skip to content

Commit

Permalink
fix: show patch check info in logs (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
eseidel authored Sep 1, 2023
1 parent 53072a9 commit ef268ac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::config::{current_arch, current_platform, UpdateConfig};

// https://stackoverflow.com/questions/67087597/is-it-possible-to-use-rusts-log-info-for-tests
#[cfg(test)]
use std::println as debug; // Workaround to use println! for logs.
use std::{println as info, println as debug}; // Workaround to use println! for logs.

fn patches_check_url(base_url: &str) -> String {
return format!("{}/api/v1/patches/check", base_url);
Expand Down Expand Up @@ -280,7 +280,11 @@ pub fn send_patch_check_request(
platform: current_platform().to_string(),
arch: current_arch().to_string(),
};
debug!("Sending patch check request: {:?}", request);
// Dumping the request should be info! since we direct users to look for it
// in the logs: https://docs.shorebird.dev/troubleshooting#how-to-fix-it-1
// Another option would be to make verbosity configurable via a key
// in shorebird.yaml.
info!("Sending patch check request: {:?}", request);
let url = &patches_check_url(&config.base_url);
let patch_check_request_fn = config.network_hooks.patch_check_request_fn;
let response = patch_check_request_fn(url, request)?;
Expand Down

0 comments on commit ef268ac

Please sign in to comment.