17#ifndef __mrtrix_exception_h__
18#define __mrtrix_exception_h__
26#ifdef MRTRIX_AS_R_LIBRARY
48 extern void (*
print) (
const std::string& msg);
56 inline void __print_stderr (
const std::string& text)
58#ifdef MRTRIX_AS_R_LIBRARY
59 REprintf (text.c_str());
71#define CONSOLE(msg) if (MR::App::log_level >= 1) report_to_user_func (msg, -1)
72#define FAIL(msg) if (MR::App::log_level >= 0) report_to_user_func (msg, 0)
73#define WARN(msg) if (MR::App::log_level >= 1) report_to_user_func (msg, 1)
74#define INFO(msg) if (MR::App::log_level >= 2) report_to_user_func (msg, 2)
75#define DEBUG(msg) if (MR::App::log_level >= 3) report_to_user_func (msg, 3)
106 for (
auto s :
e.description)
145 const int prev_level;
void push_back(const std::string &s)
vector< std::string > description
const std::string & operator[](size_t n) const
void display(int log_level=0) const
Exception(const Exception &previous_exception, const std::string &msg)
static void(* display_func)(const Exception &E, int log_level)
void push_back(const Exception &e)
Exception(const std::string &msg)
InvalidImageException(const std::string &msg)
InvalidImageException(const Exception &previous_exception, const std::string &msg)
LogLevelLatch(const int new_level)
void cmdline_print_func(const std::string &msg)
void(* report_to_user_func)(const std::string &msg, int type)
display error, warning, debug, etc. message to user
void(* print)(const std::string &msg)
print primary output to stdout as-is.
void display_exception_cmdline(const Exception &E, int log_level)
void check_app_exit_code()
void cmdline_report_to_user_func(const std::string &msg, int type)