3 ms·
I wrote something similar a couple years ago, except my macro automatically compiled to a no op if compiled in release mode, which is very convenient for switch
by hellofunk 7y ago
I wrote something similar a couple years ago, except my macro automatically compiled to a no op if compiled in release mode, which is very convenient for switching back-and-forth to the testing.
- sharkdp 7y agoThank you for the feedback. We deliberately chose not to do this (see discussion in https://github.com/sharkdp/dbg-macro/issues/26 https://github.com/sharkdp/dbg-macro/issues/26), mainly for the reasons given in the Rust documentation: > The dbg! macro works exactly the same in release builds. This is useful when debugging issues that only occur in release builds or when debugging in release mode is significantly faster. Note, however, that the C++ dbg(..) macro can be easily disabled to a no-op (identity-op, to be precise) with the DBG_MACRO_DISABLE flag.