From 74755308d5eb193df47e8e94b8114f7d46288639 Mon Sep 17 00:00:00 2001 From: Marek Kaput Date: Wed, 11 Oct 2023 19:07:34 +0200 Subject: [PATCH] Add tracing instrumentation to package ops (#789) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Stack**: - #790 - #783 - #767 - #789 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.* --- scarb/src/ops/package.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scarb/src/ops/package.rs b/scarb/src/ops/package.rs index 2ece347cb..60fa3a357 100644 --- a/scarb/src/ops/package.rs +++ b/scarb/src/ops/package.rs @@ -49,6 +49,7 @@ enum ArchiveFileContents { Generated(Box Result>>), } +#[tracing::instrument(level = "debug", skip(opts, ws))] pub fn package( packages: &[PackageId], opts: &PackageOpts, @@ -62,6 +63,7 @@ pub fn package( .collect() } +#[tracing::instrument(level = "debug", skip(opts, ws))] pub fn package_list( packages: &[PackageId], opts: &PackageOpts, @@ -78,6 +80,7 @@ fn before_package(ws: &Workspace<'_>) -> Result<()> { Ok(()) } +#[tracing::instrument(level = "trace", skip(_opts, ws))] fn package_one_impl( pkg_id: PackageId, _opts: &PackageOpts, @@ -192,6 +195,7 @@ fn prepare_archive_recipe(pkg: &Package) -> Result { Ok(recipe) } +#[tracing::instrument(level = "trace", skip_all)] fn source_files(pkg: &Package) -> Result { list_source_files(pkg)? .into_iter() @@ -245,6 +249,7 @@ fn sort_recipe(recipe: &mut ArchiveRecipe) { }); } +#[tracing::instrument(level = "trace", skip_all)] fn normalize_manifest(pkg: Package) -> Result> { let mut buf = Vec::new(); @@ -278,6 +283,7 @@ fn normalize_manifest(pkg: Package) -> Result> { /// Compress and package the recipe, and write it into the given file. /// /// Returns the uncompressed size of the contents of the archive. +#[tracing::instrument(level = "trace", skip_all)] fn tar( pkg_id: PackageId, recipe: ArchiveRecipe,