emit

Macro dbg

Source
dbg!() { /* proc-macro */ }
Expand description

Emit a temporary debug event.

§Syntax

(property),*
tpl, (property),*

where

  • tpl: A template string literal.
  • property: A Rust field-value for a property to capture.

§Properties

Properties that appear within the template or after it are added to the emitted event. The identifier of the property is its key. Property capturing can be adjusted through the as_* attribute macros.

Unlike debug, this macro captures values using their Debug implementation by default.

§When to use dbg

This macro is a convenient way to pepper debug logs through code, but follows the same recommendations as the standard library’s dbg macro. You shouldn’t expect dbg statements to be long lived, and use the debug macro instead with more deliberate data.