Skip to content

Commit

Permalink
Auto merge of #12991 - weihanglo:tracing-config-load, r=
Browse files Browse the repository at this point in the history
refactor: log when loading config from file

When I was tracing some nasty bug and wanted to point at config probding, I wish there were some logs standing out and telling me I was wrong.

Would be great if every config file loading is logged.
  • Loading branch information
bors committed Nov 16, 2023
2 parents f23b190 + 1e58b10 commit 73d6b05
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cargo/util/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,8 @@ impl Config {
path.display()
);
}
tracing::debug!(?path, ?why_load, includes, "load config from file");

let contents = fs::read_to_string(path)
.with_context(|| format!("failed to read configuration file `{}`", path.display()))?;
let toml = parse_document(&contents, path, self).with_context(|| {
Expand Down

0 comments on commit 73d6b05

Please sign in to comment.