Skip to content

Commit

Permalink
fix(log): Trace parameters to align with profile
Browse files Browse the repository at this point in the history
This is a follow up to rust-lang#13532 and prep for rust-lang#13399
  • Loading branch information
epage committed Mar 5, 2024
1 parent 19141bd commit f16067a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/cargo/core/compiler/fingerprint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,10 @@ pub use dirty_reason::DirtyReason;
/// transitively propagate throughout the dependency graph, it only forces this
/// one unit which is very unlikely to be what you want unless you're
/// exclusively talking about top-level units.
#[tracing::instrument(skip(build_runner, unit))]
#[tracing::instrument(
skip(build_runner, unit),
fields(package_id = %unit.pkg.package_id(), target = unit.target.name())
)]
pub fn prepare_target(
build_runner: &mut BuildRunner<'_, '_>,
unit: &Unit,
Expand Down
14 changes: 7 additions & 7 deletions src/cargo/core/global_cache_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ impl GlobalCacheTracker {
///
/// These orphaned files will be added to `delete_paths` so that the
/// caller can delete them.
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip(conn, gctx, base, delete_paths))]
fn sync_db_with_files(
conn: &Connection,
now: Timestamp,
Expand Down Expand Up @@ -797,7 +797,7 @@ impl GlobalCacheTracker {
}

/// For parent tables, add any entries that are on disk but aren't tracked in the db.
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip(conn, now, base_path))]
fn update_parent_for_missing_from_db(
conn: &Connection,
now: Timestamp,
Expand Down Expand Up @@ -825,7 +825,7 @@ impl GlobalCacheTracker {
///
/// This could happen for example if the user manually deleted the file or
/// any such scenario where the filesystem and db are out of sync.
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip(conn, base_path))]
fn update_db_for_removed(
conn: &Connection,
parent_table_name: &str,
Expand Down Expand Up @@ -855,7 +855,7 @@ impl GlobalCacheTracker {
}

/// Removes database entries for any files that are not on disk for the parent tables.
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip(conn, base_path, child_base_paths, delete_paths))]
fn update_db_parent_for_removed_from_disk(
conn: &Connection,
parent_table_name: &str,
Expand Down Expand Up @@ -893,7 +893,7 @@ impl GlobalCacheTracker {
/// Updates the database to add any `.crate` files that are currently
/// not tracked (such as when they are downloaded by an older version of
/// cargo).
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip(conn, now, base_path))]
fn populate_untracked_crate(
conn: &Connection,
now: Timestamp,
Expand Down Expand Up @@ -928,7 +928,7 @@ impl GlobalCacheTracker {

/// Updates the database to add any files that are currently not tracked
/// (such as when they are downloaded by an older version of cargo).
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip(conn, now, gctx, base_path, populate_size))]
fn populate_untracked(
conn: &Connection,
now: Timestamp,
Expand Down Expand Up @@ -994,7 +994,7 @@ impl GlobalCacheTracker {
/// size.
///
/// `update_db_for_removed` should be called before this is called.
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip(conn, gctx, base_path))]
fn update_null_sizes(
conn: &Connection,
gctx: &GlobalContext,
Expand Down

0 comments on commit f16067a

Please sign in to comment.