FleCSI User API Version: 2.3.0
 
Loading...
Searching...
No Matches
Logging

Configurable, parallel logging. More...

Classes

struct  guard
 Scope guard for categorizing output. More...
 
struct  tag
 A tag for labeling output to enable. More...
 

Macros

#define fixme()
 Alias for severity level warn.
 
#define flog(severity)
 This handles all of the different logging modes for the insertion style logging interface.
 
#define flog_assert(test, message)
 Flog assertion interface.
 
#define flog_error(stream)
 Method style interface for error level severity log entries.
 
#define flog_fatal(message)
 Throw a runtime exception with the provided message.
 
#define flog_info(stream)
 Method style interface for info level severity log entries.
 
#define flog_trace(stream)
 Method style interface for trace level severity log entries.
 
#define flog_warn(stream)
 Method style interface for warn level severity log entries.
 

Functions

void add_output_stream (std::string const &label, std::ostream &stream, bool colorize=false)
 Add an output stream to FLOG.
 
void flush ()
 Explicitly flush buffered flog output.
 
auto tags ()
 Get all defined tags.
 

Detailed Description

Configurable, parallel logging.

If disabled at configuration time, no output is produced.

#include "flecsi/flog.hh"

The name flecsi::log may also be used, but is deprecated.

Macro Definition Documentation

◆ flog

#define flog (   severity)

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

Parameters
severityThe severity level of the log entry.

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;
#define flog(severity)
This handles all of the different logging modes for the insertion style logging interface.
Definition flog.hh:297

◆ flog_trace

#define flog_trace (   stream)

Method style interface for trace level severity log entries.

Parameters
streamThe stream to be printed.

Usage

int value{20};
// Print the value at trace severity level
flog_trace("Value: " << value);
#define flog_trace(stream)
Method style interface for trace level severity log entries.
Definition flog.hh:314

◆ flog_info

#define flog_info (   stream)

Method style interface for info level severity log entries.

Parameters
streamThe stream to be printed.

Usage

int value{20};
// Print the value at info severity level
flog_info("Value: " << value);
#define flog_info(stream)
Method style interface for info level severity log entries.
Definition flog.hh:334

◆ flog_warn

#define flog_warn (   stream)

Method style interface for warn level severity log entries.

Parameters
streamThe stream to be printed.

Usage

int value{20};
// Print the value at warn severity level
flog_warn("Value: " << value);
#define flog_warn(stream)
Method style interface for warn level severity log entries.
Definition flog.hh:354

◆ flog_error

#define flog_error (   stream)

Method style interface for error level severity log entries.

Parameters
streamThe stream to be printed.

Usage

int value{20};
// Print the value at error severity level
flog_error("Value: " << value);
#define flog_error(stream)
Method style interface for error level severity log entries.
Definition flog.hh:374

◆ fixme

#define fixme ( )

Alias for severity level warn.

◆ flog_fatal

#define flog_fatal (   message)

Throw a runtime exception with the provided message.

If FLECSI_BACKTRACE is set in the environment and NDEBUG is not defined, produce a backtrace.

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. Nor do they use Flog's output streams, because they cannot be aggregated across processes.

Usage

int value{20};
// Print the value and exit
flog_fatal("Value: " << value);
#define flog_fatal(message)
Throw a runtime exception with the provided message.
Definition flog.hh:504

◆ flog_assert

#define flog_assert (   test,
  message 
)

Flog 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");
#define flog_assert(test, message)
Flog assertion interface.
Definition flog.hh:562

Function Documentation

◆ flush()

void flush ( )

Explicitly flush buffered flog output.

#include "flecsi/execution.hh"

◆ tags()

auto tags ( )

Get all defined tags.

Returns
a range of std::string objects

◆ add_output_stream()

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

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).