List of all members
blaze::logging::LogSection Class Reference

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...
 
Forbidden operations
LogSectionoperator= (const LogSection &)=delete
 
void * operator new (std::size_t)=delete
 
void * operator new[] (std::size_t)=delete
 
void * operator new (std::size_t, const std::nothrow_t &) noexcept=delete
 
void * operator new[] (std::size_t, const std::nothrow_t &) noexcept=delete
 
void operator delete (void *) noexcept=delete
 
void operator delete[] (void *) noexcept=delete
 
void operator delete (void *, const std::nothrow_t &) noexcept=delete
 
void operator delete[] (void *, const std::nothrow_t &) noexcept=delete
 

Private Attributes

Member variables
LogLevel level_
 The logging level of the log section.
 
std::stringstream message_
 Intermediate buffer for log messages.
 

Detailed Description

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

Constructor & Destructor Documentation

blaze::logging::LogSection::LogSection ( LogLevel  level)

Constructor for the LogSection class.

Parameters
levelThe level of the log section.
blaze::logging::LogSection::LogSection ( const LogSection ls)
inline

The copy constructor for LogSection.

Parameters
lsThe 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.

Member Function Documentation

void blaze::logging::LogSection::commit ( )

Commits the current log message to the log file.

Returns
void

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.

template<typename Type >
void blaze::logging::LogSection::log ( const Type &  message)
inline

Logs the given message to the log file.

Parameters
messageThe log message to be logged.
Returns
void
blaze::logging::LogSection::operator bool ( ) const
inline

Conversion operator to bool.

The conversion operator returns true to indicate that the logging section is active.


The documentation for this class was generated from the following files: