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

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

#include <SurgSim/Framework/Logger.h>

Collaboration diagram for SurgSim::Framework::Logger:
Collaboration graph
[legend]

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< LogOutputgetOutput () 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< LoggergetLogger (const std::string &name)
 Get a logger by name from Logger Manager. More...
 
static std::shared_ptr< LoggergetDefaultLogger ()
 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< LogOutputm_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

SurgSim::Framework::Logger::~Logger ( )
inline

Destructor.

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

Constructor.

Parameters
nameThe name used for this logger.
outputThe LogOutput instance used to display or log the data.

Member Function Documentation

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

Get default logger.

Returns
Default logger
static std::shared_ptr<Logger> SurgSim::Framework::Logger::getLogger ( const std::string &  name)
inlinestatic

Get a logger by name from Logger Manager.

Returns
A logger with given name.
std::shared_ptr< LoggerManager > SurgSim::Framework::Logger::getLoggerManager ( )
static

Get the logger manager.

Returns
Logger Manager that manages all loggers
std::string SurgSim::Framework::Logger::getName ( ) const
inline

Gets this logger's name.

Returns
The name.
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.
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.
void SurgSim::Framework::Logger::setOutput ( std::shared_ptr< LogOutput val)
inline

Sets the output object used by this logger.

Parameters
valThe output object to be used.
void SurgSim::Framework::Logger::setThreshold ( int  val)
inline

Sets the logging threshold.

Anything message with less than this level will be ignored.

Parameters
valThe value to be used as the threshold.
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
messagethe message to be printed

Friends And Related Function Documentation

friend class LoggerManager
friend

Member Data Documentation

std::string SurgSim::Framework::Logger::m_name
private
std::shared_ptr<LogOutput> SurgSim::Framework::Logger::m_output
private
int SurgSim::Framework::Logger::m_threshold
private

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