Skip to content

Add a way to give backtraces for logging #90698

Closed
@jyn514

Description

@jyn514

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

DebuggingOptions, DB_OPTIONS, "Z", "debugging",

Metadata

Metadata

Assignees

Labels

A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions