Logging facilities for PFASST++. More...
Functions | |
string | format_mpi_rank (const char fill= ' ') |
Formats the local MPI world rank as a string. More... | |
string | get_log_file_name () |
Composes the log file name for the local rank. More... | |
void | set_global_logging_options (el::Configurations *conf, const el::Configurations *default_conf=nullptr) |
Sets global logging options. More... | |
static void | add_custom_logger (const string &id) |
Provides convenient way of adding additional named loggers. More... | |
static void | load_default_config () |
Sets default configuration for default loggers. More... | |
static void | set_logging_flags () |
Sets some default flags for easylogging++. More... | |
static void | test_logging_levels () |
Prints example logging for all logging levels for the default logger. More... | |
static void | start_log (int argc, char **argv) |
Starts easylogging++ with given arguments and loads configuration. More... | |
Variables | |
static size_t | stack_position |
static bool | initialized = false |
internal flag identifying whether the default logger has been initialized. More... | |
Logging facilities for PFASST++.
As PFASST++ is using easylogging++ as the logging backend, there are six distinced logging levels plus ten additional verbose logging levels.
To achieve consistent logging throughout PFASST++ and its examples, we agree on the following conventions for using the different levels:
INFO
is used for general important messages to the userDEBUG
is ment for developping purposes and is only active when compiled without -DNDEBUG
VLOG
- the verbose logging levels are used as follows:
|
inlinestatic |
Provides convenient way of adding additional named loggers.
With this function one can easily create additional named loggers distinctable by the id
. The first LOGGER_ID_LENGTH characters of the ID (as uppercase) will be included in every line of the log. The ID is used in the actual logging calls.
This results in the log line (for the default value of LOGGER_ID_LENGTH):
<TIME> [MYCUSTOM, INFO ] a logging message
In case MPI is enabled, the line will also contain the MPI rank as given by pfasst::config::get_rank():
<TIME> [MYCUSTOM, INFO , MPI <rank> ] a logging message
[in] | id | the ID of the logger; this is used in logging calls |
CLOG
(and CVLOG
for verbose logging) to be able to specify a specific logger. Otherwise the default logger will be used.Definition at line 360 of file logging.hpp.
References OUT::blue, OUT::bold, format_mpi_rank(), pfasst::config::options::get_instance(), pfasst::config::options::get_variables_map(), LOGGER_ID_LENGTH, OUT::magenta, ML_CLOG, OUT::red, OUT::reset, set_global_logging_options(), and OUT::white.
Referenced by pfasst::examples::boris::init_logs(), pfasst::examples::advection_diffusion::AdvectionDiffusionSweeper< time >::init_logs(), load_default_config(), and main().
|
static |
internal flag identifying whether the default logger has been initialized.
Definition at line 247 of file logging.hpp.
Referenced by pfasst::config::get_rank(), pfasst::config::options::init(), and load_default_config().
|
static |
Global static helper variable to achieve nested indentation of logging output across different scopes.
Definition at line 240 of file logging.hpp.
Referenced by start_log().