-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New macro: pdbg!
(pretty debug)
#103334
New macro: pdbg!
(pretty debug)
#103334
Conversation
The main intended use-case of this new macro is to relieve the user from having to choose between writing long boilerplate (`println!`) and having a messy output (`dbg!`). This new macro may be helpful especially when exploring new Rust features (for example in Rust playground) for educational purposes to understand how the feature works. It's modeled after the existing `dbg!` macro, except that it skips the (in some situations) redundant and distracting info about file name and line number. Another difference is that the new `pdbg!`macro will insert a new line at the end to make it easier for the user to identify where each output begins and ends at a quick glance, which may be helpful for example when outputting an enum or a struct, or some other multi-line output.
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thomcc (or someone else) soon. Please see the contribution instructions for more information. |
I personally would be inclined to say that this probably is better off as something you use in your own projects -- I'm not sure I'm convinced avoiding the file/line part of That said, if you want to make a case for it: this needs an API change proposal, as mentioned by the bot. See https://std-dev-guide.rust-lang.org/feature-lifecycle/api-change-proposals.html and https://github.com/rust-lang/libs-team/issues/new?assignees=&labels=api-change-proposal%2C+T-libs-api&template=api-change-proposal.md&title=%28My+API+Change+Proposal%29 for how to do that. |
This comment has been minimized.
This comment has been minimized.
The job Click to see the possible cause of the failure (guessed by this bot)
|
The author has opened an ACP at rust-lang/libs-team#125 |
The author has closed the ACP and there's no follow-up ACP so I am assuming there's no interest of taking this further. Even if there is, this will get stuck waiting for that ACP to be written and then accepted, so probably better to make the PR after that step. |
ACP: rust-lang/libs-team#125
The main intended use-case of this new macro is to relieve the user from having to choose between writing long boilerplate (
println!
) and having a messy output (dbg!
).This new macro may be helpful especially when exploring new Rust features (for example in Rust playground) for educational purposes to understand how the feature works. It's modeled after the existing
dbg!
macro, except that it skips the (in some situations) redundant and distracting info about file name and line number. Another difference is that the newpdbg!
macro will insert a new line at the end to make it easier for the user to identify where each output begins and ends at a quick glance, which may be helpful for example when outputting an enum or a struct, or some other multi-line output.