[−][src]Attribute Macro trace::trace
#[trace]
Enables tracing the execution of functions
It supports the following optional arguments (see the examples
folder for examples of using
each of these):
-
prefix_enter
- The prefix of theprintln!
statement when a function is entered. Defaults to[+]
. -
prefix_exit
- The prefix of theprintln!
statement when a function is exited. Defaults to[-]
. -
enable
- When applied to amod
orimpl
,enable
takes a list of function names to print, not printing any functions that are not part of this list. All functions are enabled by default. When applied to animpl
method or a function,enable
takes a list of arguments to print, not printing any arguments that are not part of the list. All arguments are enabled by default. -
disable
- When applied to amod
orimpl
,disable
takes a list of function names to not print, printing all other functions in themod
orimpl
. No functions are disabled by default. When applied to animpl
method or a function,disable
takes a list of arguments to not print, printing all other arguments. No arguments are disabled by default. -
pause
- When given as an argument to#[trace]
, execution is paused after each line of tracing output until enter is pressed. This allows you to trace through a program step by step. Disabled by default. -
pretty
- Pretty print the output (use{:#?}
instead of{:?}
). Disabled by default. -
logging
- Uselog::trace!
from thelog
crate instead ofprintln
. Disabled by default.
Note that enable
and disable
can not be used together, and doing so will result in an error.