![]() |
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...
#include <LogSection.h>
Public Member Functions | |
Constructors | |
LogSection (LogLevel level) | |
Constructor for the LogSection class. More... | |
LogSection (const LogSection &ls) | |
The copy constructor for LogSection. More... | |
Destructor | |
~LogSection () | |
Destructor for the LogSection class. | |
Conversion operators | |
operator bool () const | |
Conversion operator to bool. More... | |
Logging functions | |
template<typename Type > | |
void | log (const Type &message) |
Logs the given message to the log file. More... | |
void | commit () |
Commits the current log message to the log file. More... | |
Private Member Functions | |
Forbidden operations | |
LogSection & | operator= (const LogSection &) |
void * | operator new (std::size_t) |
void * | operator new[] (std::size_t) |
void * | operator new (std::size_t, const std::nothrow_t &) |
void * | operator new[] (std::size_t, const std::nothrow_t &) |
void | operator delete (void *) |
void | operator delete[] (void *) |
void | operator delete (void *, const std::nothrow_t &) |
void | operator delete[] (void *, const std::nothrow_t &) |
Private Attributes | |
Member variables | |
LogLevel | level_ |
The logging level of the log section. | |
std::stringstream | message_ |
Intermediate buffer for log messages. | |
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).
blaze::logging::LogSection::LogSection | ( | LogLevel | level | ) |
Constructor for the LogSection class.
level | The level of the log section. |
|
inline |
The copy constructor for LogSection.
ls | The log section to be copied. |
The copy constructor is explicitly defined in order to enable its use in the log sections despite the non-copyable stringstream member variable.
void blaze::logging::LogSection::commit | ( | ) |
Commits the current log message to the log file.
This function commits the current log message to the log file. The function is automatically called at the end of a log section, but can also be used manually in order to intermediately commit log messages, for instance in the case of nested log sections.
|
inline |
Logs the given message to the log file.
message | The log message to be logged. |
|
inline |
Conversion operator to bool.
The conversion operator returns true to indicate that the logging section is active.