File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -729,7 +729,8 @@ top-level module will be called `foo`, and you can set `RUST_LOG` to
729
729
` foo ` to enable ` warn ` , ` info ` and ` debug ` logging for the module.
730
730
731
731
Turned-off ` log ` statements impose minimal overhead on the code that
732
- contains them, so except in code that needs to be really, really fast,
732
+ contains them, because the arguments to ` log ` are evaluated lazily.
733
+ So except in code that needs to be really, really fast,
733
734
you should feel free to scatter around debug logging statements, and
734
735
leave them in.
735
736
@@ -743,6 +744,9 @@ and will log the formatted string:
743
744
#error("fatal: %s", get_error_string());
744
745
~~~~
745
746
747
+ Because the macros ` #debug ` , ` #warn ` , and ` #error ` expand to calls to ` log ` ,
748
+ their arguments are also lazily evaluated.
749
+
746
750
## Assertions
747
751
748
752
The keyword ` assert ` , followed by an expression with boolean type,
You can’t perform that action at this time.
0 commit comments