SurgSim::Framework::Logger Class Reference
Logging API

An object that can be used to control logging parameters, such as verbosity and log output destination. More...

`#include <SurgSim/Framework/Logger.h>`

## Public Member Functions

| ~Logger ()
| Destructor. More...
bool | writeMessage (const std::string &message)
| Uses the contained instance of LogOutput to write the log message. More...
int | getThreshold () const
| Gets the logging threshold. More...
void | setThreshold (int val)
| Sets the logging threshold. More...
std::shared_ptr< LogOutput > | getOutput () const
| Gets the output object used by this logger. More...
void | setOutput (std::shared_ptr< LogOutput > val)
| Sets the output object used by this logger. More...
std::string | getName () const
| Gets this logger's name. More...

## Static Public Member Functions

static std::shared_ptr< Logger > | getLogger (const std::string &name)
| Get a logger by name from Logger Manager. More...
static std::shared_ptr< Logger > | getDefaultLogger ()
| Get default logger. More...
static std::shared_ptr< LoggerManager > | getLoggerManager ()
| Get the logger manager. More...

## Private Member Functions

| Logger (const std::string &name, std::shared_ptr< LogOutput > output)
| Constructor. More...

## Private Attributes

int | m_threshold
std::string | m_name
std::shared_ptr< LogOutput > | m_output

## Friends

class | LoggerManager

## Detailed Description

An object that can be used to control logging parameters, such as verbosity and log output destination.

## Constructor & Destructor Documentation

## ~Logger()

SurgSim::Framework::Logger::~Logger | ( |  | ) |

inline

Destructor.

## Logger()

SurgSim::Framework::Logger::Logger | ( | const std::string & | name,
|  | std::shared_ptr< LogOutput > | output
| ) |  |

private

Constructor.

Parameters

  name | The name used for this logger.
  output | The LogOutput instance used to display or log the data.

## Member Function Documentation

## getDefaultLogger()

static std::shared_ptr<Logger> SurgSim::Framework::Logger::getDefaultLogger | ( |  | ) |

inline static

Get default logger.

Returns
  Default logger

## getLogger()

static std::shared_ptr<Logger> SurgSim::Framework::Logger::getLogger | ( | const std::string & | name | ) |

inline static

Get a logger by name from Logger Manager.

Returns
  A logger with given name.

## getLoggerManager()

std::shared_ptr< LoggerManager > SurgSim::Framework::Logger::getLoggerManager | ( |  | ) |

static

Get the logger manager.

Returns
  Logger Manager that manages all loggers

## getName()

std::string SurgSim::Framework::Logger::getName | ( |  | ) | const

inline

Gets this logger's name.

Returns
  The name.

## getOutput()

std::shared_ptr<LogOutput> SurgSim::Framework::Logger::getOutput | ( |  | ) | const

inline

Gets the output object used by this logger.

Returns
  The current output object used this logger.

## getThreshold()

int SurgSim::Framework::Logger::getThreshold | ( |  | ) | const

inline

Gets the logging threshold.

Anything message with less than this level will be ignored.

Returns
  The threshold value.

## setOutput()

void SurgSim::Framework::Logger::setOutput | ( | std::shared_ptr< LogOutput > | val | ) |

inline

Sets the output object used by this logger.

Parameters

  val | The output object to be used.

## setThreshold()

void SurgSim::Framework::Logger::setThreshold | ( | int | val | ) |

inline

Sets the logging threshold.

Anything message with less than this level will be ignored.

Parameters

  val | The value to be used as the threshold.

## writeMessage()

bool SurgSim::Framework::Logger::writeMessage | ( | const std::string & | message | ) |

inline

Uses the contained instance of LogOutput to write the log message.

Returns
  true on success

Parameters

  message | the message to be printed

## Friends And Related Function Documentation

## LoggerManager

friend class LoggerManager

friend

## Member Data Documentation

## m_name

std::string SurgSim::Framework::Logger::m_name

private

## m_output

std::shared_ptr<LogOutput> SurgSim::Framework::Logger::m_output

private

## m_threshold

int SurgSim::Framework::Logger::m_threshold

private

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

- SurgSim/Framework/Logger.h
- SurgSim/Framework/Logger.cpp