The FleCSI logging utility (flog) provides a C++ interface for capturing output during program execution.
◆ fixme
#define fixme |
( |
| ) |
flog(warn) |
Alias for severity level warn.
◆ flog
Value: \
\
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
-
severity | The 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};
flog(info) <<
"Value: " << value << std::endl;
flog(warn) <<
"Value: " << value << std::endl;
◆ flog_assert
#define flog_assert |
( |
|
test, |
|
|
|
message |
|
) |
| |
Value: \
\
do \
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
-
test | The test condition. |
message | The 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
◆ flog_error
#define flog_error |
( |
|
message | ) |
|
Value: \
\
::flecsi::log::error_log_message_t(__FILE__, __LINE__).stream() << message
Method style interface for error level severity log entries.
- Parameters
-
message | The stream message to be printed. |
Usage
◆ flog_fatal
#define flog_fatal |
( |
|
message | ) |
|
Value: \
\
{ \
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(); \
}
Throw a runtime exception with the provided message.
- Parameters
-
message | The 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
◆ flog_info
#define flog_info |
( |
|
message | ) |
|
Value: \
\
::flecsi::log::info_log_message_t(__FILE__, __LINE__).stream() << message
Method style interface for info level severity log entries.
- Parameters
-
message | The stream message to be printed. |
Usage
◆ flog_trace
#define flog_trace |
( |
|
message | ) |
|
Value: \
\
::flecsi::log::trace_log_message_t(__FILE__, __LINE__).stream() << message
Method style interface for trace level severity log entries.
- Parameters
-
message | The stream message to be printed. |
Usage
◆ flog_warn
#define flog_warn |
( |
|
message | ) |
|
Value: \
\
::flecsi::log::warn_log_message_t(__FILE__, __LINE__).stream() << message
Method style interface for warn level severity log entries.
- Parameters
-
message | The stream message to be printed. |
Usage
◆ 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
-
label | An identifier for the stream. This can be used to access or update an output stream after it has been added. |
stream | The output stream to add. |
colorize | Indicates whether the output to this stream should be colorized. It is useful to turn colorization off for non-interactive output (default). |