#include <loggingLoggable.h>
Public Member Functions | |
Loggable () | |
Loggable (const std::string &loggerName) | |
Loggable (Logger::LoggerSmartPtr logger) | |
virtual Logger::LoggerSmartPtr | getLogger () const |
virtual void | setLogger (Logger::LoggerSmartPtr logger) |
virtual | ~Loggable () |
Private Attributes | |
Logger::LoggerSmartPtr | logger_m |
Loggable is a base class for all classes that want to be able to use the logging system. It has just to very basic simple features:
Logging::Loggable::Loggable | ( | ) |
Constructor without parameters. This will set the default global logger.
Logging::Loggable::Loggable | ( | const std::string & | loggerName | ) |
Constructor with a logger name. This will instantiate a new logger with the given name.
loggerName | A name for the logger. This should be a dot-separated name and should normally be based on the container/ component/client name. |
Logging::Loggable::Loggable | ( | Logger::LoggerSmartPtr | logger | ) |
Constructor from another logger.
logger | A smart pointer to an existing logger. This is assigned to the internal smart pointer so that the reference counting will make sure it will not be destroyed until in usage. |
virtual Logging::Loggable::~Loggable | ( | ) | [virtual] |
Destructor.
virtual Logger::LoggerSmartPtr Logging::Loggable::getLogger | ( | ) | const [virtual] |
virtual void Logging::Loggable::setLogger | ( | Logger::LoggerSmartPtr | logger | ) | [inline, virtual] |
Sets logger. In this way is possible to (re)set the logger latter. A smart pointer to an existing logger. This is assigned to the internal smart pointer so that the reference counting will make sure it will not be destroyed until in usage.
References logger_m.
The logger
Referenced by setLogger().