mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
Improve derbugg logging (#1738)
* Improve derbugg logging Make it more readable Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix excessive logging Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> --------- Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
a2d2c5d85c
commit
4687726c66
10 changed files with 54 additions and 15 deletions
|
@ -212,7 +212,7 @@ impl Download<'_> {
|
|||
///
|
||||
/// NOTE that this API does not support gnu extension sparse file unlike
|
||||
/// [`Download::and_extract`].
|
||||
#[instrument(skip(visitor))]
|
||||
#[instrument(skip(self, visitor))]
|
||||
pub async fn and_visit_tar(
|
||||
self,
|
||||
fmt: TarBasedFmt,
|
||||
|
@ -239,7 +239,10 @@ impl Download<'_> {
|
|||
/// Download a file from the provided URL and extract it to the provided path.
|
||||
///
|
||||
/// NOTE that this will only extract directory and regular files.
|
||||
#[instrument(skip(path))]
|
||||
#[instrument(
|
||||
skip(self, path),
|
||||
fields(path = format_args!("{}", path.as_ref().display()))
|
||||
)]
|
||||
pub async fn and_extract(
|
||||
self,
|
||||
fmt: PkgFmt,
|
||||
|
@ -277,7 +280,7 @@ impl Download<'_> {
|
|||
inner(self, fmt, path.as_ref()).await
|
||||
}
|
||||
|
||||
#[instrument]
|
||||
#[instrument(skip(self))]
|
||||
pub async fn into_bytes(self) -> Result<Bytes, DownloadError> {
|
||||
let bytes = self.content.into_response().await?.bytes().await?;
|
||||
if let Some(verifier) = self.data_verifier {
|
||||
|
|
|
@ -165,7 +165,12 @@ impl Client {
|
|||
///
|
||||
/// Return `Ok(ControlFlow::Break(response))` when succeeds and no need
|
||||
/// to retry.
|
||||
#[instrument]
|
||||
#[instrument(
|
||||
skip(self, url),
|
||||
fields(
|
||||
url = format_args!("{url}"),
|
||||
),
|
||||
)]
|
||||
async fn do_send_request(
|
||||
&self,
|
||||
request: Request,
|
||||
|
|
|
@ -26,7 +26,7 @@ impl Resolve for TrustDnsResolver {
|
|||
}
|
||||
}
|
||||
|
||||
#[instrument(level = "trace")]
|
||||
#[instrument]
|
||||
fn new_resolver() -> Result<TokioAsyncResolver, BoxError> {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ fn new_resolver() -> Result<TokioAsyncResolver, BoxError> {
|
|||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[instrument(level = "trace")]
|
||||
#[instrument]
|
||||
fn get_adapter() -> Result<ipconfig::Adapter, BoxError> {
|
||||
debug!("Retrieving local IP address");
|
||||
let local_ip =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue