globjects  1.1.0.2f0c753c8647
Strict OpenGL objects wrapper.
globjects::LogMessageBuilder Class Reference

Builds a LogMessage from different kinds of primitive types. More...

#include <globjects/include/globjects/base/LogMessageBuilder.h>

Public Types

using PrecisionManipulator = decltype(std::setprecision(0))
 
using FillManipulator = decltype(std::setfill('0'))
 
using WidthManipulator = decltype(std::setw(0))
 

Public Member Functions

 LogMessageBuilder (LogMessageLevel level, AbstractLogHandler *handler)
 
 LogMessageBuilder (const LogMessageBuilder &builder)
 
virtual ~LogMessageBuilder ()
 
LogMessageBuilderoperator<< (const char *c)
 
LogMessageBuilderoperator<< (const std::string &str)
 
LogMessageBuilderoperator<< (bool b)
 
LogMessageBuilderoperator<< (char c)
 
LogMessageBuilderoperator<< (int i)
 
LogMessageBuilderoperator<< (float f)
 
LogMessageBuilderoperator<< (double d)
 
LogMessageBuilderoperator<< (long double d)
 
LogMessageBuilderoperator<< (unsigned u)
 
LogMessageBuilderoperator<< (long l)
 
LogMessageBuilderoperator<< (long long l)
 
LogMessageBuilderoperator<< (unsigned long ul)
 
LogMessageBuilderoperator<< (unsigned char uc)
 
LogMessageBuilderoperator<< (const void *pointer)
 
LogMessageBuilderoperator<< (std::ostream &(*manipulator)(std::ostream &))
 
LogMessageBuilderoperator<< (PrecisionManipulator manipulator)
 
LogMessageBuilderoperator<< (FillManipulator manipulator)
 
LogMessageBuilderoperator<< (WidthManipulator manipulator)
 
template<typename T >
LogMessageBuilderoperator<< (const ref_ptr< T > &ref_pointer)
 
template<typename T >
LogMessageBuilderoperator<< (const T *pointer)
 
template<typename T >
LogMessageBuilderoperator<< (const std::vector< T > &vector)
 
template<typename T , std::size_t Count>
LogMessageBuilderoperator<< (const std::array< T, Count > &array)
 

Protected Attributes

LogMessageLevel m_level
 
AbstractLogHandlerm_handler
 
std::shared_ptr< std::stringstream > m_stream
 

Detailed Description

Builds a LogMessage from different kinds of primitive types.

The LogMessageBuilder is usually created by one of the global functions log, debug, warning, error or fatal. It works similar to streams and accepts a number of different types which will be converted to strings automatically. When it goes out of scope, it creates a LogMessage from all streamed objects and sends it to the log handler.

Typical usage of the LogMessageBuilder:

warning() << "This is warning number " << 3;
See also
logging.h
LogMessage
setLoggingHandler
setVerbosityLevel
info
debug
warning
critical

Member Typedef Documentation

using globjects::LogMessageBuilder::PrecisionManipulator = decltype(std::setprecision(0))
using globjects::LogMessageBuilder::FillManipulator = decltype(std::setfill('0'))
using globjects::LogMessageBuilder::WidthManipulator = decltype(std::setw(0))

Constructor & Destructor Documentation

globjects::LogMessageBuilder::LogMessageBuilder ( LogMessageLevel  level,
AbstractLogHandler handler 
)
globjects::LogMessageBuilder::LogMessageBuilder ( const LogMessageBuilder builder)
virtual globjects::LogMessageBuilder::~LogMessageBuilder ( )
virtual

Member Function Documentation

LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( const char *  c)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( const std::string &  str)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( bool  b)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( char  c)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( int  i)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( float  f)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( double  d)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( long double  d)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( unsigned  u)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( long  l)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( long long  l)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( unsigned long  ul)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( unsigned char  uc)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( const void *  pointer)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( std::ostream &(*)(std::ostream &)  manipulator)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( PrecisionManipulator  manipulator)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( FillManipulator  manipulator)
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( WidthManipulator  manipulator)
template<typename T >
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( const ref_ptr< T > &  ref_pointer)
template<typename T >
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( const T *  pointer)
template<typename T >
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( const std::vector< T > &  vector)
template<typename T , std::size_t Count>
LogMessageBuilder& globjects::LogMessageBuilder::operator<< ( const std::array< T, Count > &  array)

Member Data Documentation

LogMessageLevel globjects::LogMessageBuilder::m_level
protected
AbstractLogHandler* globjects::LogMessageBuilder::m_handler
protected
std::shared_ptr<std::stringstream> globjects::LogMessageBuilder::m_stream
protected

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