All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SurgSim::Framework::LogMessageBase Class Reference

LogMessageBase is a base class to be used to customize messages for logging textual information can be put into a log message by using the << operator in general the message class will output all of its information when the destructor is being invoked, formats the incoming message to timestamp it and adds information about the logger. More...

#include <SurgSim/Framework/LogMessageBase.h>

Inheritance diagram for SurgSim::Framework::LogMessageBase:
Inheritance graph
[legend]
Collaboration diagram for SurgSim::Framework::LogMessageBase:
Collaboration graph
[legend]

Public Member Functions

 LogMessageBase (Logger *logger, int level)
 Construct a LogMessage. More...
 
 ~LogMessageBase ()
 Destructor. More...
 
template<typename T >
LogMessageBaseoperator<< (T &&input)
 Add the given input to the current log message. More...
 
LogMessageBaseoperator<< (std::ios_base &(*manipulator)(std::ios_base &))
 
LogMessageBaseoperator<< (std::ostream &(*manipulator)(std::ostream &))
 

Protected Member Functions

std::string getMessage ()
 
void flush ()
 write the current message to the logger More...
 

Private Attributes

std::ostringstream m_stream
 
Loggerm_logger
 

Detailed Description

LogMessageBase is a base class to be used to customize messages for logging textual information can be put into a log message by using the << operator in general the message class will output all of its information when the destructor is being invoked, formats the incoming message to timestamp it and adds information about the logger.

Constructor & Destructor Documentation

SurgSim::Framework::LogMessageBase::LogMessageBase ( Logger logger,
int  level 
)

Construct a LogMessage.

Parameters
loggerThe logger to be used
levelThe logging level for this message
SurgSim::Framework::LogMessageBase::~LogMessageBase ( )
inline

Destructor.

Member Function Documentation

void SurgSim::Framework::LogMessageBase::flush ( )
inlineprotected

write the current message to the logger

std::string SurgSim::Framework::LogMessageBase::getMessage ( )
inlineprotected
Returns
the current content of the message to be logged
template<typename T >
LogMessageBase& SurgSim::Framework::LogMessageBase::operator<< ( T &&  input)
inline

Add the given input to the current log message.

Parameters
inputThe input to be added to the current stream
LogMessageBase& SurgSim::Framework::LogMessageBase::operator<< ( std::ios_base &(*)(std::ios_base &)  manipulator)
inline
LogMessageBase& SurgSim::Framework::LogMessageBase::operator<< ( std::ostream &(*)(std::ostream &)  manipulator)
inline

Member Data Documentation

Logger* SurgSim::Framework::LogMessageBase::m_logger
private
std::ostringstream SurgSim::Framework::LogMessageBase::m_stream
private

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