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 the println! statement when a function is entered. Defaults to [+].

  • prefix_exit - The prefix of the println! statement when a function is exited. Defaults to [-].

  • enable - When applied to a mod or impl, 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 an impl 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 a mod or impl, disable takes a list of function names to not print, printing all other functions in the mod or impl. No functions are disabled by default. When applied to an impl 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 - Use log::trace! from the log crate instead of println. Disabled by default.

Note that enable and disable can not be used together, and doing so will result in an error.