| //! Private macro used for error handling. |
| /// Logs an error, ignores an `Ok` value. |
| macro_rules! log_if_err { |
| /// Matches a result, returning the `Ok` value in case of success, |
| /// exits the calling function otherwise. |
| /// A closure which returns the return value for the function can |
| /// be passed as second parameter. |
| macro_rules! try_else_return { |
| try_else_return!($x, || {}) |
| crate::error::log_error(&e); |
| /// Print an error message to stdout. Format is the same as println! or format! |
| println!("Criterion.rs ERROR: {}", &format!($($arg)*)) |
| /// Print a debug message to stdout. Format is the same as println! or format! |
| if $crate::debug_enabled() { |
| println!("Criterion.rs DEBUG: {}", &format!($($arg)*)); |