![]() |
Classes | |
class | blaze::logging::FunctionTrace |
RAII object for function tracing.The FunctionTrace class is an auxiliary helper class for the tracing of function calls. It is implemented as a wrapper around the Logger class and is responsible for the atomicity of the logging operations of trace information. More... | |
class | blaze::logging::Logger |
Implementation of a logger class.The Logger class represents the core of the logging functionality. It is responsible for commiting logging messages immediately to the according log file(s). The logger works for both serial as well as MPI parallel environments. In case of a non-MPI-parallel simulation the Logger creates the log file 'blaze.log', which contains all logging information from all logging levels. In case of a MPI parallel simulation, each process creates his own individual log file called 'blazeX.log', where 'X' is replaced by the according rank the process has in the MPI_COMM_WORLD communicator. Note that the log file(s) are only created in case any logging information is created. This might for instance result in only a small number of log file(s) in MPI parallel simulations when only some of the processes encounter errors/warnings/etc. Note that the logging functionality may not be used before MPI_Init() has been finished. In consequence, this means that no global data that is initialized before the main() function may contain any use of the logging functionality! More... | |
class | blaze::logging::LogSection |
Logging section for (non-)MPI-parallel environments.The LogSection class is an auxiliary helper class for all logging section macros. It is implemented as a wrapper around the Logger class and is responsible for the atomicity of the logging operations and for formatting any message that is written into the log file(s). More... | |
Macros | |
#define | BLAZE_LOG_DEBUG_SECTION(NAME) |
Logging section for debug information.This macro starts a log section for debug information. These messages are written to the log file(s) in case the blaze::loglevel has been set to debug or higher. The following example demonstrates how this log section is used: More... | |
#define | BLAZE_LOG_DETAIL_SECTION(NAME) |
Logging section for debug information.This macro starts a log section for detail information. These messages are written to the log file(s) in case the blaze::loglevel has been set to detail or higher. The following example demonstrates how this log section is used: More... | |
#define | BLAZE_LOG_ERROR_SECTION(NAME) |
Logging section for (severe) error messages.This macro starts a log section for (severe) error messages. These messages are written to the log file(s) in case the blaze::loglevel has been set to error or higher. The following example demonstrates how this log section is used: More... | |
#define | BLAZE_FUNCTION_TRACE |
Function trace macro.This macro can be used to reliably trace function calls. In case function tracing is activated, the traces are logged via the Logger class. The following, short example demonstrates how the function trace macro is used: More... | |
#define | BLAZE_LOG_INFO_SECTION(NAME) |
Logging section for information messages.This macro starts a log section for information messages. These messages are written to the log file(s) in case the blaze::loglevel has been set to info or higher. The following example demonstrates how this log section is used: More... | |
#define | BLAZE_LOG_PROGRESS_SECTION(NAME) |
Logging section for progress information.This macro starts a log section for information messages. These messages are written to the log file(s) in case the blaze::loglevel has been set to progress or higher. The following example demonstrates how this log section is used: More... | |
#define | BLAZE_LOG_WARNING_SECTION(NAME) |
Logging section for warning messages.This macro starts a log section for warning messages. These messages are written to the log file(s) in case the blaze::loglevel has been set to warning or higher. The following example demonstrates how this log section is used: More... | |
Enumerations | |
enum | blaze::logging::LogLevel { blaze::logging::inactive = 0, blaze::logging::error = 1, blaze::logging::warning = 2, blaze::logging::info = 3, blaze::logging::progress = 4, blaze::logging::debug = 5, blaze::logging::detail = 6 } |
Logging levels.The LogLevel type enumeration represents the type of the global logging level. It defines all possible levels for the logging functionality. Depending on the setting of the global logging level (see blaze::logLevel), more or less information will be written to the log file(s). The following logging levels are available: More... | |
LogSection operators | |
template<typename Type > | |
LogSection & | blaze::logging::operator<< (LogSection &logsection, const Type &message) |
Global output operator for the LogSection class. More... | |
The logging submodule offers the functionality for the creation of log information in both non-parallel and MPI-/thread-parallel environments. The logging functionality is implemented such that in case no logging is required no runtime and memory overhead occur. However, in case it is necessary to log information, this is done as efficiently and reliably as possible. In non-parallel environments, a single log file named 'blaze.log' is created, containing all the information of the single process. In MPI-parallel environments, each process creates his own log file named 'blazeX.log', where 'X' is replaced by his according process rank in the MPI_COMM_WORLD communicator. Depending on the selected logging level information about (severe) errors, warnings, important information, progress reports, debug information, and detailed output is written to the log file(s). The global log level is specified via the blaze::loglevel variable in the configuration file "blaze/config/Logging.h". The following logging level's are available:
Logging is done via one of the six following log sections:
The following example demonstrates the use of the log sections:
Executing this main() function results in the following log file (provided the logging level is set accordingly):
The next example shows to nested log sections. Please note that this combination only makes sense in case the outer log section has a lower log level:
Although the BLAZE_LOG_ERROR_SECTION is the outer section, the BLAZE_LOG_WARNING_SECTION appears first in the log file:
In order to commit the messages in the correct order, it is necessary to manually call the commit function:
This results in the following log file:
#define BLAZE_FUNCTION_TRACE |
Function trace macro.This macro can be used to reliably trace function calls. In case function tracing is activated, the traces are logged via the Logger class. The following, short example demonstrates how the function trace macro is used:
The macro should be used as the very first statement inside the function in order to guarantee that logging the function trace is the very first and last action of the function call.
Function tracing can be enabled or disabled via the BLAZE_USE_FUNCTION_TRACES macro. If function tracing is activated, the resulting log will contain trace information of the following form:
In case function tracing is deactivated, all function trace functionality is completely removed from the code, i.e. no function traces are logged and no overhead results from the BLAZE_FUNCTION_TRACE macro.
#define BLAZE_LOG_DEBUG_SECTION | ( | NAME | ) |
Logging section for debug information.This macro starts a log section for debug information. These messages are written to the log file(s) in case the blaze::loglevel has been set to debug or higher. The following example demonstrates how this log section is used:
Note that uncaught exceptions emitted from the blaze::BLAZE_LOG_DEBUG_SECTION might result in lost and/or unlogged information!
#define BLAZE_LOG_DETAIL_SECTION | ( | NAME | ) |
Logging section for debug information.This macro starts a log section for detail information. These messages are written to the log file(s) in case the blaze::loglevel has been set to detail or higher. The following example demonstrates how this log section is used:
Note that uncaught exceptions emitted from the blaze::BLAZE_LOG_DETAIL_SECTION might result in lost and/or unlogged information!
#define BLAZE_LOG_ERROR_SECTION | ( | NAME | ) |
Logging section for (severe) error messages.This macro starts a log section for (severe) error messages. These messages are written to the log file(s) in case the blaze::loglevel has been set to error or higher. The following example demonstrates how this log section is used:
Note that uncaught exceptions emitted from the blaze::BLAZE_LOG_ERROR_SECTION might result in lost and/or unlogged information!
#define BLAZE_LOG_INFO_SECTION | ( | NAME | ) |
Logging section for information messages.This macro starts a log section for information messages. These messages are written to the log file(s) in case the blaze::loglevel has been set to info or higher. The following example demonstrates how this log section is used:
Note that uncaught exceptions emitted from the blaze::BLAZE_LOG_INFO_SECTION might result in lost and/or unlogged information!
#define BLAZE_LOG_PROGRESS_SECTION | ( | NAME | ) |
Logging section for progress information.This macro starts a log section for information messages. These messages are written to the log file(s) in case the blaze::loglevel has been set to progress or higher. The following example demonstrates how this log section is used:
Note that uncaught exceptions emitted from the blaze::BLAZE_LOG_PROGRESS_SECTION might result in lost and/or unlogged information!
#define BLAZE_LOG_WARNING_SECTION | ( | NAME | ) |
Logging section for warning messages.This macro starts a log section for warning messages. These messages are written to the log file(s) in case the blaze::loglevel has been set to warning or higher. The following example demonstrates how this log section is used:
Note that uncaught exceptions emitted from the blaze::BLAZE_LOG_WARNING_SECTION might result in lost and/or unlogged information!
Logging levels.The LogLevel type enumeration represents the type of the global logging level. It defines all possible levels for the logging functionality. Depending on the setting of the global logging level (see blaze::logLevel), more or less information will be written to the log file(s). The following logging levels are available:
inactive plays a special role in the way that it switches off the logging functionality completely, i.e., no log file(s) will be created. The highest logging level is error, which exclusively writes severe errors to the log file(s). The lowest logging level is detail, which can create a tremendous amount of logging information. Note that each logging level comprises all higher logging levels. For instance, progress will also print all errors and warning to the log file(s).
|
inline |
Global output operator for the LogSection class.
logsection | Reference to the log section. |
message | Reference to the log message. |