Attribute Macro func_trace::trace [−][src]
#[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 amodorimpl,enabletakes 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 animplmethod or a function,enabletakes 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 amodorimpl,disabletakes a list of function names to not print, printing all other functions in themodorimpl. No functions are disabled by default. When applied to animplmethod or a function,disabletakes 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 thelogcrate instead ofprintln. Disabled by default.
Note that enable and disable can not be used together, and doing so will result in an error.