Interface Documentation
Version: invalid
Classes | Macros | Functions
FleCSI Logging Interface (flog)

Classes

struct  flecsi::log::tag
 
struct  flecsi::log::guard
 

Macros

#define flog(severity)
 
#define flog_trace(message)
 
#define flog_info(message)
 
#define flog_warn(message)
 
#define flog_error(message)
 
#define fixme()   flog(warn)
 
#define flog_fatal(message)
 
#define flog_assert(test, message)
 

Functions

void flecsi::log::add_output_stream (std::string const &label, std::ostream &stream, bool colorize=false)
 

Detailed Description

The FleCSI logging utility (flog) provides a C++ interface for capturing output during program execution.

Macro Definition Documentation

◆ fixme

#define fixme ( )    flog(warn)

Alias for severity level warn.

◆ flog

#define flog (   severity)
Value:
/* MACRO IMPLEMENTATION */ \
\
true && ::flecsi::log::severity##_log_message_t(__FILE__, __LINE__, false) \
.stream()

This handles all of the different logging modes for the insertion style logging interface.

Parameters
severityThe severity level of the log entry.
Note
The form "true && ..." is necessary for tertiary argument evaluation so that the std::ostream & returned by the stream() function can be implicitly converted to an int.

Usage

int value{20};
// Print the value at info severity level
flog(info) << "Value: " << value << std::endl;
// Print the value at warn severity level
flog(warn) << "Value: " << value << std::endl;

◆ flog_assert

#define flog_assert (   test,
  message 
)
Value:
/* MACRO IMPLEMENTATION */ \
\
do \
if(!(test)) { \
flog_fatal(message); \
} \
while(0)
int test(ARGS &&... args)
Definition: execution.hh:411

Clog assertion interface. Assertions allow the developer to catch invalid program state. This call will invoke flog_fatal if the test condition is false.

Parameters
testThe test condition.
messageThe stream message to be printed.
Note
Failed assertions are not disabled by tags or by the ENABLE_FLOG or FLOG_STRIP_LEVEL build options, i.e., they are always active.

Usage

int value{20};
// Print the value and exit
flog_assert(value == 20, "invalid value");

◆ flog_error

#define flog_error (   message)
Value:
/* MACRO IMPLEMENTATION */ \
\
::flecsi::log::error_log_message_t(__FILE__, __LINE__).stream() << message

Method style interface for error level severity log entries.

Parameters
messageThe stream message to be printed.

Usage

int value{20};
// Print the value at error severity level
flog_error("Value: " << value);

◆ flog_fatal

#define flog_fatal (   message)
Value:
/* MACRO IMPLEMENTATION */ \
\
{ \
std::stringstream _sstream; \
_sstream << FLOG_OUTPUT_LTRED("FATAL ERROR ") \
<< FLOG_OUTPUT_YELLOW(::flecsi::log::rstrip<'/'>(__FILE__) \
<< ":" << __LINE__ << " ") \
<< FLOG_OUTPUT_LTRED(message) << std::endl; \
__flog_internal_wait_on_flusher(); \
std::cerr << _sstream.str() << std::endl; \
::flecsi::log::dumpstack(); \
std::abort(); \
} /* scope */

Throw a runtime exception with the provided message.

Parameters
messageThe stream message to be printed.
Note
Fatal level severity log entires are not disabled by tags or by the ENABLE_FLOG or FLOG_STRIP_LEVEL build options, i.e., they are always active.

Usage

int value{20};
// Print the value and exit
flog_fatal("Value: " << value);

◆ flog_info

#define flog_info (   message)
Value:
/* MACRO IMPLEMENTATION */ \
\
::flecsi::log::info_log_message_t(__FILE__, __LINE__).stream() << message

Method style interface for info level severity log entries.

Parameters
messageThe stream message to be printed.

Usage

int value{20};
// Print the value at info severity level
flog_info("Value: " << value);

◆ flog_trace

#define flog_trace (   message)
Value:
/* MACRO IMPLEMENTATION */ \
\
::flecsi::log::trace_log_message_t(__FILE__, __LINE__).stream() << message

Method style interface for trace level severity log entries.

Parameters
messageThe stream message to be printed.

Usage

int value{20};
// Print the value at trace severity level
flog_trace("Value: " << value);

◆ flog_warn

#define flog_warn (   message)
Value:
/* MACRO IMPLEMENTATION */ \
\
::flecsi::log::warn_log_message_t(__FILE__, __LINE__).stream() << message

Method style interface for warn level severity log entries.

Parameters
messageThe stream message to be printed.

Usage

int value{20};
// Print the value at warn severity level
flog_warn("Value: " << value);

Function Documentation

◆ add_output_stream()

void flecsi::log::add_output_stream ( std::string const &  label,
std::ostream &  stream,
bool  colorize = false 
)
inline

Add an output stream to FLOG.

Parameters
labelAn identifier for the stream. This can be used to access or update an output stream after it has been added.
streamThe output stream to add.
colorizeIndicates whether the output to this stream should be colorized. It is useful to turn colorization off for non-interactive output (default).