16 #ifndef SURGSIM_FRAMEWORK_LOGGERMANAGER_H 17 #define SURGSIM_FRAMEWORK_LOGGERMANAGER_H 19 #include <boost/thread/mutex.hpp> 20 #include <unordered_map> 57 std::shared_ptr<Logger>
getLogger(
const std::string& name);
67 void setThreshold(
const std::string& path,
int threshold);
75 std::unordered_map<std::string, std::shared_ptr<Logger>>
m_loggers;
97 #endif //SURGSIM_FRAMEWORK_LOGGERMANAGER_H Definition: CompoundShapeToGraphics.cpp:29
int getThreshold() const
Return the threshold used by all loggers.
Definition: LoggerManager.cpp:79
std::unordered_map< std::string, std::shared_ptr< Logger > > m_loggers
Keep track of all the loggers.
Definition: LoggerManager.h:75
int m_globalThreshold
Threshold used by all loggers.
Definition: LoggerManager.h:84
~LoggerManager()
Destructor.
Definition: LoggerManager.cpp:38
boost::mutex m_mutex
Definition: LoggerManager.h:86
std::shared_ptr< LogOutput > m_defaultOutput
Use for default output of the logger.
Definition: LoggerManager.h:81
void setThreshold(int threshold)
Sets a threshold for all loggers.
Definition: LoggerManager.cpp:54
std::shared_ptr< Logger > 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...
Definition: LoggerManager.cpp:85
std::shared_ptr< LogOutput > getDefaultOutput() const
Return the default output.
Definition: LoggerManager.cpp:48
void setDefaultOutput(std::shared_ptr< LogOutput > output)
Sets/Changes default output.
Definition: LoggerManager.cpp:43
LoggerManager()
Constructor.
Definition: LoggerManager.cpp:30
std::shared_ptr< Logger > getDefaultLogger()
Gets the default logger.
Definition: LoggerManager.cpp:114
Class to safely handle access to a group of loggers, manipulate the global logging threshold...
Definition: LoggerManager.h:33
LoggerManager & operator=(const LoggerManager &)
std::vector< std::pair< std::string, int > > m_thresholds
Keep track of subgroup thresholds.
Definition: LoggerManager.h:78