42 #include <pcl/pcl_exports.h>
43 #include <pcl/pcl_config.h>
49 #define PCL_LOG_STREAM(LEVEL, STREAM, CSTR, ATTR, FG, ARGS) if(pcl::console::isVerbosityLevelEnabled(pcl::console::LEVEL)) { fflush(stdout); pcl::console::change_text_color(CSTR, pcl::console::ATTR, pcl::console::FG); STREAM << ARGS; pcl::console::reset_text_color(CSTR); }
51 #define PCL_ALWAYS_STREAM(ARGS) PCL_LOG_STREAM(L_ALWAYS, std::cout, stdout, TT_RESET, TT_WHITE, ARGS)
52 #define PCL_ERROR_STREAM(ARGS) PCL_LOG_STREAM(L_ERROR, std::cerr, stderr, TT_BRIGHT, TT_RED, ARGS)
53 #define PCL_WARN_STREAM(ARGS) PCL_LOG_STREAM(L_WARN, std::cerr, stderr, TT_BRIGHT, TT_YELLOW, ARGS)
54 #define PCL_INFO_STREAM(ARGS) PCL_LOG_STREAM(L_INFO, std::cout, stdout, TT_RESET, TT_WHITE, ARGS)
55 #define PCL_DEBUG_STREAM(ARGS) PCL_LOG_STREAM(L_DEBUG, std::cout, stdout, TT_RESET, TT_GREEN, ARGS)
56 #define PCL_VERBOSE_STREAM(ARGS) PCL_LOG_STREAM(L_VERBOSE, std::cout, stdout, TT_RESET, TT_WHITE, ARGS)
59 #define PCL_ALWAYS(...) pcl::console::print (pcl::console::L_ALWAYS, __VA_ARGS__)
60 #define PCL_ERROR(...) pcl::console::print (pcl::console::L_ERROR, __VA_ARGS__)
61 #define PCL_WARN(...) pcl::console::print (pcl::console::L_WARN, __VA_ARGS__)
62 #define PCL_INFO(...) pcl::console::print (pcl::console::L_INFO, __VA_ARGS__)
63 #define PCL_DEBUG(...) pcl::console::print (pcl::console::L_DEBUG, __VA_ARGS__)
64 #define PCL_VERBOSE(...) pcl::console::print (pcl::console::L_VERBOSE, __VA_ARGS__)
65 #define PCL_HIGH(...) pcl::console::print_highlight (__VA_ARGS__)
67 #define PCL_ASSERT_ERROR_PRINT_CHECK(pred, msg) \
73 PCL_ERROR("In File %s, in line %d\n" __FILE__, __LINE__); \
77 #define PCL_ASSERT_ERROR_PRINT_RETURN(pred, msg, err) \
80 PCL_ASSERT_ERROR_PRINT_CHECK(pred, msg); \
81 if (!(pred)) return err; \
PCL_EXPORTS void enableColoredOutput(FILE *stream, bool enable)
Enable or disable colored text output, overriding the default behavior.
PCL_EXPORTS void print_color(FILE *stream, int attr, int fg, const char *format,...)
Print a message on stream with colors.
PCL_EXPORTS void setVerbosityLevel(VERBOSITY_LEVEL level)
set the verbosity level
PCL_EXPORTS void print_debug(const char *format,...)
Print a debug message on stream with colors.
PCL_EXPORTS void print(VERBOSITY_LEVEL level, FILE *stream, const char *format,...)
Print a message on stream.
PCL_EXPORTS void print_highlight(const char *format,...)
Print a highlighted info message on stream with colors.
PCL_EXPORTS bool isVerbosityLevelEnabled(VERBOSITY_LEVEL severity)
is verbosity level enabled?
PCL_EXPORTS void reset_text_color(FILE *stream)
Reset the text color (on either stdout or stderr) to its original state.
PCL_EXPORTS void print_warn(const char *format,...)
Print a warning message on stream with colors.
PCL_EXPORTS void print_error(const char *format,...)
Print an error message on stream with colors.
PCL_EXPORTS void change_text_color(FILE *stream, int attribute, int fg, int bg)
Change the text color (on either stdout or stderr) with an attr:fg:bg.
PCL_EXPORTS void print_info(const char *format,...)
Print an info message on stream with colors.
PCL_EXPORTS VERBOSITY_LEVEL getVerbosityLevel()
get the verbosity level.
PCL_EXPORTS void print_value(const char *format,...)
Print a value message on stream with colors.
PCL_EXPORTS bool initVerbosityLevel()
initialize verbosity level.