Use tracing
spans to trace the entire MIR interp stack
This commit is contained in:
parent
535d27ac9a
commit
43c181bac4
6 changed files with 74 additions and 39 deletions
|
@ -11,6 +11,7 @@ crate-type = ["dylib"]
|
|||
libc = "0.2"
|
||||
tracing = { version = "0.1.18" }
|
||||
tracing-subscriber = { version = "0.2.10", default-features = false, features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"] }
|
||||
tracing-tree = "0.1.6"
|
||||
rustc_middle = { path = "../rustc_middle" }
|
||||
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
|
||||
rustc_target = { path = "../rustc_target" }
|
||||
|
|
|
@ -1241,11 +1241,21 @@ pub fn init_env_logger(env: &str) {
|
|||
Ok(s) if s.is_empty() => return,
|
||||
Ok(_) => {}
|
||||
}
|
||||
let builder = tracing_subscriber::FmtSubscriber::builder();
|
||||
let filter = tracing_subscriber::EnvFilter::from_env(env);
|
||||
let layer = tracing_tree::HierarchicalLayer::default()
|
||||
.with_indent_lines(true)
|
||||
.with_ansi(true)
|
||||
.with_targets(true)
|
||||
.with_thread_ids(true)
|
||||
.with_thread_names(true)
|
||||
.with_wraparound(10)
|
||||
.with_verbose_exit(true)
|
||||
.with_verbose_entry(true)
|
||||
.with_indent_amount(2);
|
||||
|
||||
let builder = builder.with_env_filter(tracing_subscriber::EnvFilter::from_env(env));
|
||||
|
||||
builder.init()
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
let subscriber = tracing_subscriber::Registry::default().with(filter).with(layer);
|
||||
tracing::subscriber::set_global_default(subscriber).unwrap();
|
||||
}
|
||||
|
||||
pub fn main() -> ! {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue