Skip to content

Make debug!, etc. macros not require a format string - #5278

Closed
brson wants to merge 1 commit into
rust-lang:incomingfrom
brson:logplusplus
Closed

Make debug!, etc. macros not require a format string#5278
brson wants to merge 1 commit into
rust-lang:incomingfrom
brson:logplusplus

Conversation

@brson

@brson brson commented Mar 8, 2013

Copy link
Copy Markdown
Contributor

r?

log can polymorphically log anything, but debug!, etc. requires a format string. With this patch you can equivalently write debug!(foo) or debug!("%?", foo).

I'm doing this because I was trying to remove log (replacing it with nothing, at least temporarily), but there are a number of logging statements that just want to print an arbitrary value and don't care about the format string.

I'm not entirely convinced this is a good change, since it overloads the implementation of these macros and makes their usage slightly more nuanced.

The one thing `log` can still do is polymorphically log anything,
but debug!, etc. require a format string. With this patch
you can equivalently write `debug!(foo)` or `debug!("%?", foo)`
bors added a commit that referenced this pull request Mar 8, 2013
r?

`log` can  polymorphically log anything, but debug!, etc. requires a format string. With this patch you can equivalently write `debug!(foo)` or `debug!("%?", foo)`.

I'm doing this because I was trying to remove `log` (replacing it with nothing, at least temporarily), but there are a number of logging statements that just want to print an arbitrary value and don't care about the format string.

I'm not entirely convinced this is a good change, since it overloads the implementation of these macros and makes their usage slightly more nuanced.
@bors bors closed this Mar 8, 2013
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
5278: expect should be a dev dep r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
RalfJung added a commit to RalfJung/rust that referenced this pull request Aug 25, 2026
…when-reliable

run `f16` and `f128` tests natively when reliable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants