Skip to content

Commit 0fea007

Browse files
James HigginsMark-Simulacrum
James Higgins
authored andcommitted
Add type_name info to [TIMING] log output
1 parent b759b22 commit 0fea007

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/bootstrap/builder.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::any::Any;
1+
use std::any::{type_name, Any};
22
use std::cell::{Cell, RefCell};
33
use std::collections::BTreeSet;
44
use std::env;
@@ -1763,7 +1763,16 @@ impl<'a> Builder<'a> {
17631763
};
17641764

17651765
if self.config.print_step_timings && !self.config.dry_run {
1766-
println!("[TIMING] {:?} -- {}.{:03}", step, dur.as_secs(), dur.subsec_millis());
1766+
let step_string = format!("{:?}", step);
1767+
let brace_index = step_string.find("{").unwrap_or(0);
1768+
let type_string = type_name::<S>();
1769+
println!(
1770+
"[TIMING] {} {} -- {}.{:03}",
1771+
&type_string.strip_prefix("bootstrap::").unwrap_or(type_string),
1772+
&step_string[brace_index..],
1773+
dur.as_secs(),
1774+
dur.subsec_millis()
1775+
);
17671776
}
17681777

17691778
{

0 commit comments

Comments
 (0)