blockfactory  0.8
A framework for wrapping algorithms for dataflow programming
blockfactory::core::Log Class Reference

Class for handling log messages. More...

#include <Log.h>

Detailed Description

Class for handling log messages.

Errors and Warnings are currently supported.

Public Types

enum  Type { Type::ERROR, Type::WARNING }
 
enum  Verbosity { Verbosity::RELEASE, Verbosity::DEBUG }
 

Public Member Functions

 Log ()
 
 ~Log ()=default
 
std::stringstream & getLogStringStream (const Type &type, const std::string &file, const unsigned &line, const std::string &function)
 Get the stringstream object for adding log messages. More...
 
std::string getErrors () const
 Get the stored error messages. More...
 
std::string getWarnings () const
 Get the stored warning messages. More...
 
void clearErrors ()
 Clear the stored error messages. More...
 
void clearWarnings ()
 Clear the stored warning messages. More...
 
void clear ()
 Clear all the stored log messages. More...
 

Static Public Member Functions

static blockfactory::core::LoggetSingleton ()
 Get the Log singleton. More...
 

Member Enumeration Documentation

Enumerator
ERROR 
WARNING 
Enumerator
RELEASE 
DEBUG 

Constructor & Destructor Documentation

blockfactory::core::Log::Log ( )
blockfactory::core::Log::~Log ( )
default

Member Function Documentation

void blockfactory::core::Log::clear ( )

Clear all the stored log messages.

void blockfactory::core::Log::clearErrors ( )

Clear the stored error messages.

void blockfactory::core::Log::clearWarnings ( )

Clear the stored warning messages.

std::string blockfactory::core::Log::getErrors ( ) const

Get the stored error messages.

Returns
The error messages.
std::stringstream& blockfactory::core::Log::getLogStringStream ( const Type type,
const std::string &  file,
const unsigned &  line,
const std::string &  function 
)

Get the stringstream object for adding log messages.

Parameters
typeThe log type.
fileThe file from which this method is called (preprocessor directive).
lineThe line from which this method is called (preprocessor directive).
functionThe function from which this method is called (preprocessor directive).
Returns
The stringstream object matching the log type.
static blockfactory::core::Log& blockfactory::core::Log::getSingleton ( )
static

Get the Log singleton.

There is only one instance of this class in the whole process.

Returns
The log singleton.
std::string blockfactory::core::Log::getWarnings ( ) const

Get the stored warning messages.

Returns
The warning messages.

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