opensurgsim
Public Member Functions | List of all members
SurgSim::Framework::LoggerManager Class Reference

Class to safely handle access to a group of loggers, manipulate the global logging threshold, and fetch logger(s) from a global pool. More...

#include <LoggerManager.h>

Public Member Functions

 LoggerManager ()
 Constructor.
 
 ~LoggerManager ()
 Destructor.
 
void setDefaultOutput (std::shared_ptr< LogOutput > output)
 Sets/Changes default output. More...
 
std::shared_ptr< LogOutputgetDefaultOutput () const
 Return the default output.
 
std::shared_ptr< LoggergetDefaultLogger ()
 Gets the default logger. More...
 
std::shared_ptr< LoggergetLogger (const std::string &name)
 Gets a logger with a given name, creates a new one if none exists or the logger has been deallocated. More...
 
void setThreshold (int threshold)
 Sets a threshold for all loggers. More...
 
void setThreshold (const std::string &path, int threshold)
 Sets a threshold for a subgroup of loggers, the group is chosen by finding all loggers whose pathname starts with the same string as the pathname given. More...
 
int getThreshold () const
 Return the threshold used by all loggers. More...
 

Detailed Description

Class to safely handle access to a group of loggers, manipulate the global logging threshold, and fetch logger(s) from a global pool.

Member Function Documentation

§ getDefaultLogger()

std::shared_ptr< Logger > SurgSim::Framework::LoggerManager::getDefaultLogger ( )

Gets the default logger.

Returns
The default logger.

§ getLogger()

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

Gets a logger with a given name, creates a new one if none exists or the logger has been deallocated.

Parameters
nameThe name.
Returns
The logger.

§ getThreshold()

int SurgSim::Framework::LoggerManager::getThreshold ( ) const

Return the threshold used by all loggers.

Returns
Threshold used by all the loggers.

§ setDefaultOutput()

void SurgSim::Framework::LoggerManager::setDefaultOutput ( std::shared_ptr< LogOutput output)

Sets/Changes default output.

Parameters
outputThe output class to be used.

§ setThreshold() [1/2]

void SurgSim::Framework::LoggerManager::setThreshold ( int  threshold)

Sets a threshold for all loggers.

Parameters
thresholdThe threshold.

§ setThreshold() [2/2]

void SurgSim::Framework::LoggerManager::setThreshold ( const std::string &  path,
int  threshold 
)

Sets a threshold for a subgroup of loggers, the group is chosen by finding all loggers whose pathname starts with the same string as the pathname given.

Parameters
pathFull pathname of the file.
thresholdThe threshold to use for these loggers.

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