SurgSim::Framework::LogMessageBase Class Reference
Logging API » Internal logging helpers

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:

## Public Member Functions

| LogMessageBase (Logger *logger, int level)
| Construct a LogMessage. More...
| ~LogMessageBase ()
| Destructor. More...
template<typename T >
LogMessageBase & | operator<< (T &&input)
| Add the given input to the current log message. More...
LogMessageBase & | operator<< (std::ios_base &(*manipulator)(std::ios_base &))
LogMessageBase & | operator<< (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
Logger * | m_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

## LogMessageBase()

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

Construct a LogMessage.

Parameters

  logger | The logger to be used
  level | The logging level for this message

## ~LogMessageBase()

SurgSim::Framework::LogMessageBase::~LogMessageBase | ( |  | ) |

inline

Destructor.

## Member Function Documentation

## flush()

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

inline protected

write the current message to the logger

## getMessage()

std::string SurgSim::Framework::LogMessageBase::getMessage | ( |  | ) |

inline protected

Returns
  the current content of the message to be logged

## operator<<() [1/3]

template<typename T >

LogMessageBase& SurgSim::Framework::LogMessageBase::operator<< | ( | T && | input | ) |

inline

Add the given input to the current log message.

Parameters

  input | The input to be added to the current stream

## operator<<() [2/3]

LogMessageBase& SurgSim::Framework::LogMessageBase::operator<< | ( | std::ios_base &(*)(std::ios_base &) | manipulator | ) |

inline

## operator<<() [3/3]

LogMessageBase& SurgSim::Framework::LogMessageBase::operator<< | ( | std::ostream &(*)(std::ostream &) | manipulator | ) |

inline

## Member Data Documentation

## m_logger

Logger* SurgSim::Framework::LogMessageBase::m_logger

private

## m_stream

std::ostringstream SurgSim::Framework::LogMessageBase::m_stream

private

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

- SurgSim/Framework/LogMessageBase.h
- SurgSim/Framework/LogMessageBase.cpp