All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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.
 
 LogSection (const LogSection &ls)
 The copy constructor for LogSection.
 
Destructor
 ~LogSection ()
 Destructor for the LogSection class.
 
Conversion operators
 operator bool () const
 Conversion operator to bool.
 
 operator std::ostream & ()
 Conversion operator to std::ostream&.
 
Logging functions
template<typename Type >
void log (const Type &message)
 Logs the given message to the log file.
 
void commit ()
 Commits the current log message to the log file.
 

Private Member Functions

Forbidden operations
LogSectionoperator= (const LogSection &)
 
void * operator new (std::size_t) throw ( std::bad_alloc )
 
void * operator new[] (std::size_t) throw ( std::bad_alloc )
 
void * operator new (std::size_t, const std::nothrow_t &) throw ()
 
void * operator new[] (std::size_t, const std::nothrow_t &) throw ()
 
void operator delete (void *) throw ()
 
void operator delete[] (void *) throw ()
 
void operator delete (void *, const std::nothrow_t &) throw ()
 
void operator delete[] (void *, const std::nothrow_t &) throw ()
 

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.

blaze::logging::LogSection::operator std::ostream & ( )
inline

Conversion operator to std::ostream&.

The conversion operator returns a reference to a standard output stream.


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