Description
I ran into the following problem today: I had a prebuilt (with download-rustc
) compiler and wanted to get a backtrace for some info!
logging it was outputting, to see how it got to that point. But there's no way to get a backtrace there without rebuilding the compiler from source. It would be really cool if there were a way to have backtraces for each individual logging call. To avoid making the compiler horrifically slow, it could be behind a -Zlog-backtrace=filter
flag.
This would be useful even if you have a local build of the compiler, since you don't have to rebuild it each time you want to get a stack trace.
@davidbarsky suggests doing this by adding a custom Layer
which filters based on a string. Debugging options are handled around
rust/compiler/rustc_session/src/options.rs
Line 1030 in eee8b9c