18 #include <flecsi-config.h> 20 #include "flecsi/log/utils.hh" 22 #if defined(FLECSI_ENABLE_FLOG) 32 #if defined(FLECSI_ENABLE_FLOG) 50 tag(
const char * label) : label_(label) {
75 #if defined(FLOG_ENABLE_DEVELOPER_MODE) 102 std::ostream & stream,
103 bool colorize =
false) {
136 #define flog(severity) \ 139 true && ::flecsi::log::severity##_log_message_t(__FILE__, __LINE__, false) \ 142 #if defined(FLOG_ENABLE_DEVELOPER_MODE) 144 #define flog_devel(severity) \ 148 ::flecsi::log::severity##_log_message_t(__FILE__, __LINE__, true).stream() 152 #define flog_devel(severity) \ 158 #endif // FLOG_ENABLE_DEVELOPER_MODE 178 #define flog_trace(message) \ 181 ::flecsi::log::trace_log_message_t(__FILE__, __LINE__).stream() << message 201 #define flog_info(message) \ 204 ::flecsi::log::info_log_message_t(__FILE__, __LINE__).stream() << message 224 #define flog_warn(message) \ 227 ::flecsi::log::warn_log_message_t(__FILE__, __LINE__).stream() << message 247 #define flog_error(message) \ 250 ::flecsi::log::error_log_message_t(__FILE__, __LINE__).stream() << message 252 #define __flog_internal_wait_on_flusher() usleep(FLOG_PACKET_FLUSH_INTERVAL) 254 #else // FLECSI_ENABLE_FLOG 263 guard(tag
const &) {}
266 devel_tag(
const char *) {}
269 devel_guard(devel_tag
const &) {}
278 #define flog_initialize(active) 279 #define flog_finalize() 281 #define flog(severity) \ 287 #define flog_devel(severity) \ 293 #define flog_trace(message) 294 #define flog_info(message) 295 #define flog_warn(message) 296 #define flog_error(message) 298 #define __flog_internal_wait_on_flusher() 300 #endif // FLECSI_ENABLE_FLOG 310 #define fixme() flog(warn) 312 #include <boost/stacktrace.hpp> 320 std::cerr << FLOG_OUTPUT_RED(
"FleCSI Runtime: std::abort called.")
322 << FLOG_OUTPUT_GREEN(
"Dumping stacktrace...") << std::endl;
323 std::cerr << boost::stacktrace::stacktrace() << std::endl;
325 std::cerr << FLOG_OUTPUT_RED(
"FleCSI Runtime: std::abort called.")
327 << FLOG_OUTPUT_BROWN(
"Build with '-DCMAKE_BUILD_TYPE=Debug'" 328 <<
" to enable FleCSI runtime stacktrace.")
358 #define flog_fatal(message) \ 362 std::stringstream _sstream; \ 363 _sstream << FLOG_OUTPUT_LTRED("FATAL ERROR ") \ 364 << FLOG_OUTPUT_YELLOW(::flecsi::log::rstrip<'/'>(__FILE__) \ 365 << ":" << __LINE__ << " ") \ 366 << FLOG_OUTPUT_LTRED(message) << std::endl; \ 367 __flog_internal_wait_on_flusher(); \ 368 std::cerr << _sstream.str() << std::endl; \ 369 ::flecsi::log::dumpstack(); \ 404 #define flog_assert(test, message) \ 408 (void)sizeof(test); \ 411 #define flog_assert(test, message) \ 416 flog_fatal(message); \
void add_buffer(std::string const &key, std::ostream &s, bool colorized=false)
Definition: types.hh:276
tee_stream_t & config_stream()
Definition: state.hh:236
Definition: tag_scope.hh:33
size_t register_tag(const char *tag)
Definition: state.hh:244
void add_output_stream(std::string const &label, std::ostream &stream, bool colorize=false)
Definition: flog.hh:101
static flog_t & instance()
Definition: state.hh:73
Definition: control.hh:31