opensurgsim
Public Member Functions | Static Public Member Functions | 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 <Logger.h>

Public Member Functions

 ~Logger ()
 Destructor.
 
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< LoggerManagergetLoggerManager ()
 Get the logger manager. More...
 

Friends

class LoggerManager
 

Detailed Description

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

Member Function Documentation

§ getDefaultLogger()

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

Get default logger.

Returns
Default logger

§ getLogger()

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.

§ 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
valThe 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
valThe 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
messagethe message to be printed

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