Interface Documentation
Version: invalid
Classes | Namespaces | Macros | Functions
message.hh File Reference
#include <flecsi-config.h>
#include "flecsi/log/state.hh"
#include "flecsi/log/types.hh"
#include "flecsi/log/utils.hh"
#include <iostream>
Include dependency graph for message.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  flecsi::log::log_message_t
 

Namespaces

 flecsi
 

Macros

#define severity_message_t(severity, format)
 
#define verbose_stamp   timestamp() << " " << rstrip<'/'>(file_) << ":" << line_ << " "
 
#define process_stamp   " p" << flog_t::instance().process()
 

Functions

bool flecsi::log::true_state ()
 
 flecsi::log::severity_message_t (utility, {(void) devel_;std::ostream &stream=flog_t::instance().severity_stream(flog_t::instance().tag_enabled());return stream;})
 
 flecsi::log::severity_message_t (trace, { std::ostream &stream=flog_t::instance().severity_stream(FLOG_STRIP_LEVEL< 1 &&flog_t::instance().tag_enabled());std::string devel=devel_ ? "(devel)" :"";std::string active_tag=flog_t::instance().initialized() ? flog_t::instance().active_tag_name() :"external";switch(flog_t::instance().verbose()) { case 1:{ stream<< FLOG_OUTPUT_CYAN("[trace ")<< FLOG_OUTPUT_PURPLE(devel);stream<< FLOG_OUTPUT_LTGRAY(verbose_stamp);stream<< FLOG_OUTPUT_CYAN(active_tag);stream<< FLOG_OUTPUT_GREEN(process_stamp);stream<< FLOG_OUTPUT_CYAN("] ");} break;case 0:{ stream<< FLOG_OUTPUT_CYAN("[trace ")<< FLOG_OUTPUT_PURPLE(devel);stream<< FLOG_OUTPUT_CYAN(active_tag);stream<< FLOG_OUTPUT_GREEN(process_stamp);stream<< FLOG_OUTPUT_CYAN("] ");} break;default:break;} return stream;})
 
 flecsi::log::severity_message_t (info, { std::ostream &stream=flog_t::instance().severity_stream(FLOG_STRIP_LEVEL< 2 &&flog_t::instance().tag_enabled());std::string devel=devel_ ? "devel " :"";std::string active_tag=flog_t::instance().initialized() ? flog_t::instance().active_tag_name() :"external";switch(flog_t::instance().verbose()) { case 1:{ stream<< FLOG_OUTPUT_GREEN("[info ")<< FLOG_OUTPUT_PURPLE(devel);stream<< FLOG_OUTPUT_LTGRAY(verbose_stamp);stream<< FLOG_OUTPUT_CYAN(active_tag);stream<< FLOG_OUTPUT_GREEN(process_stamp);stream<< FLOG_OUTPUT_GREEN("] ");} break;case 0:{ stream<< FLOG_OUTPUT_GREEN("[info ")<< FLOG_OUTPUT_PURPLE(devel);stream<< FLOG_OUTPUT_CYAN(active_tag);stream<< FLOG_OUTPUT_GREEN(process_stamp);stream<< FLOG_OUTPUT_GREEN("] ");} break;default:break;} return stream;})
 
 flecsi::log::severity_message_t (warn, { std::ostream &stream=flog_t::instance().severity_stream(FLOG_STRIP_LEVEL< 3 &&flog_t::instance().tag_enabled());std::string devel=devel_ ? "(devel)" :"";std::string active_tag=flog_t::instance().initialized() ? flog_t::instance().active_tag_name() :"external";switch(flog_t::instance().verbose()) { case 1:{ stream<< FLOG_OUTPUT_BROWN("[Warn ")<< FLOG_OUTPUT_PURPLE(devel);stream<< FLOG_OUTPUT_LTGRAY(verbose_stamp);stream<< FLOG_OUTPUT_CYAN(active_tag);stream<< FLOG_OUTPUT_GREEN(process_stamp);stream<< FLOG_OUTPUT_BROWN("] ")<< FLOG_COLOR_YELLOW;} break;case 0:{ stream<< FLOG_OUTPUT_BROWN("[Warn ")<< FLOG_OUTPUT_PURPLE(devel);stream<< FLOG_OUTPUT_CYAN(active_tag);stream<< FLOG_OUTPUT_GREEN(process_stamp);stream<< FLOG_OUTPUT_BROWN("] ")<< FLOG_COLOR_YELLOW;} break;default:break;} clean_color_=true;return stream;})
 
 flecsi::log::severity_message_t (error, { std::ostream &stream=flog_t::instance().severity_stream(FLOG_STRIP_LEVEL< 4 &&flog_t::instance().tag_enabled());std::string devel=devel_ ? "(devel)" :"";std::string active_tag=flog_t::instance().initialized() ? flog_t::instance().active_tag_name() :"external";switch(flog_t::instance().verbose()) { case 1:{ stream<< FLOG_OUTPUT_RED("[ERROR ")<< FLOG_OUTPUT_PURPLE(devel);stream<< FLOG_OUTPUT_LTGRAY(verbose_stamp);stream<< FLOG_OUTPUT_CYAN(active_tag);stream<< FLOG_OUTPUT_GREEN(process_stamp);stream<< FLOG_OUTPUT_RED("] ")<< FLOG_COLOR_LTRED;} break;case 0:{ stream<< FLOG_OUTPUT_RED("[ERROR ")<< FLOG_OUTPUT_PURPLE(devel);stream<< FLOG_OUTPUT_CYAN(active_tag);stream<< FLOG_OUTPUT_GREEN(process_stamp);stream<< FLOG_OUTPUT_RED("] ")<< FLOG_COLOR_LTRED;} break;default:break;} clean_color_=true;return stream;})
 

Macro Definition Documentation

◆ severity_message_t

#define severity_message_t (   severity,
  format 
)
Value:
struct severity##_log_message_t : public log_message_t { \
severity##_log_message_t(const char * file, int line, bool devel = false) \
: log_message_t(file, line), devel_(devel) {} \
\
~severity##_log_message_t() { \
/* Clean colors from the stream */ \
if(clean_color_ && !flog_t::instance().buffer_stream().str().empty()) { \
auto str = flog_t::instance().buffer_stream().str(); \
if(str.back() == '\n') { \
str = str.substr(0, str.size() - 1); \
str += FLOG_COLOR_PLAIN; \
str += '\n'; \
flog_t::instance().buffer_stream().str(std::string{}); \
flog_t::instance().buffer_stream() << str; \
} \
else { \
flog_t::instance().buffer_stream() << FLOG_COLOR_PLAIN; \
} \
} \
} \
\
std::ostream & \
stream() override /* This is replaced by the scoped logic */ \
format \
\
private : bool devel_; \
}

Function Documentation

◆ true_state()

bool flecsi::log::true_state ( )
inline

Function always returning true. Used for defaults.