-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
want version of dbg! using {:?} not {:#?} #82778
Copy link
Copy link
Closed as not planned
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I find the pretty-printing output from
dbg!more annoying than helpful and I am privately using a version of this macro that doesn't pretty-print.When I discussed this on the Discord several people also shared the same opinion about
dbg!'s pretty-printing. (No-one really said they liked it, although that's a biased sample...) This suggests that there would be demand for a compact output version in std. While the docs forstd::dbg!say the output format cannot be relied on, ISTM that changing it to remove the#would be rude (and controversial). So I suggest providing a compact version in parallel. I suggest the namedbgc!for "debug compact" but I am of course happy with whatever colour bikeshed.If the libs team thinks this would be welcome, I will make an MR for it. If the libs team don't like this idea then fine, I can keep using my clone-and-hack :-).
While I'm here I notice that the docs suggest committing calls to
dbg!is a bad idea. grepping my own codebase showed that I agree with one significant exception: I use it liberally in tests. I think it's great there and the docs could probably mention that as a good use case.