cleaner output when dbg!() is given a literal value #61141
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Hello! I'm unsure if this should be an RFC but it seems similar to #57845, so I'll start by filing an issue here.
The problem
Often I end up writing
dbg!
code with constant values, usually strings, to trace control flow.The output is a bit noisier than I'd like.
[lib/emscripten/src/syscalls/unix.rs:826] "Start loop" = "Start loop"
The solution
Detect if the argument to the macro is a literal value (assuming this is possible) and make the output just:
[lib/emscripten/src/syscalls/unix.rs:826] "Start loop"
Alternatives considered:
eprintln!
: doesn't have line and file info. It's a separate macro, so it's less aesthetically pleasing and less intuitive in my opinion.debug!
: usually I'm already using these for other tasks and filtering them out is harder and less convenient thandbg!
;dbg!
is nice because it's explicitly a temporary debugging toolThe text was updated successfully, but these errors were encountered: