Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
tree-wide: Clean up usage of tracing::instrument
Browse files Browse the repository at this point in the history
We're really verbose with `env RUST_LOG=debug`...most of
these spans shouldn't be emitting any arguments at all . And
even then let's lower to debug level for them too.
  • Loading branch information
cgwalters committed Oct 3, 2023
1 parent e74e2f9 commit cc874c1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/src/container/encapsulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ pub(crate) fn parse_oci_path_and_tag(path: &str) -> (&str, Option<&str>) {
}

/// Helper for `build()` that avoids generics
#[instrument(skip(repo, config, opts))]
#[instrument(level = "debug", skip_all)]
async fn build_impl(
repo: &ostree::Repo,
ostree_ref: &str,
Expand Down
3 changes: 1 addition & 2 deletions lib/src/container/unencapsulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub(crate) async fn join_fetch<T: std::fmt::Debug>(

/// Fetch a container image and import its embedded OSTree commit.
#[context("Importing {}", imgref)]
#[instrument(skip(repo))]
#[instrument(level = "debug", skip(repo))]
pub async fn unencapsulate(repo: &ostree::Repo, imgref: &OstreeImageReference) -> Result<Import> {
let importer = super::store::ImageImporter::new(repo, imgref, Default::default()).await?;
importer.unencapsulate().await
Expand All @@ -199,7 +199,6 @@ fn new_async_decompressor<'a>(
}

/// A wrapper for [`get_blob`] which fetches a layer and decompresses it.
//#[instrument(skip(proxy, img, layer))]
pub(crate) async fn fetch_layer_decompress<'a>(
proxy: &'a mut ImageProxy,
img: &OpenedImage,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/tar/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ pub struct TarImportOptions {

/// Read the contents of a tarball and import the ostree commit inside.
/// Returns the sha256 of the imported commit.
#[instrument(skip(repo, src))]
#[instrument(level = "debug", skip_all)]
pub async fn import_tar(
repo: &ostree::Repo,
src: impl tokio::io::AsyncRead + Send + Unpin + 'static,
Expand All @@ -831,7 +831,7 @@ pub async fn import_tar(

/// Read the contents of a tarball and import the content objects inside.
/// Generates a synthetic commit object referencing them.
#[instrument(skip(repo, src))]
#[instrument(level = "debug", skip_all)]
pub async fn import_tar_objects(
repo: &ostree::Repo,
src: impl tokio::io::AsyncRead + Send + Unpin + 'static,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/tar/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ async fn filter_tar_async(

/// Write the contents of a tarball as an ostree commit.
#[allow(unsafe_code)] // For raw fd bits
#[instrument(skip(repo, src))]
#[instrument(level = "debug", skip_all)]
pub async fn write_tar(
repo: &ostree::Repo,
src: impl tokio::io::AsyncRead + Send + Unpin + 'static,
Expand Down

0 comments on commit cc874c1

Please sign in to comment.